/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('dyplsapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddAxnTrackNoRequest {
  ownerId?: long(name='OwnerId'),
  phoneNoX?: string(name='PhoneNoX', description='The private number in the AXN binding, that is, phone number X.

You can call the [BindAxn](https://help.aliyun.com/document_detail/110258.html) operation to obtain the value of PhoneNoX.

This parameter is required.', example='1700000****'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC2235****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subsId?: string(name='SubsId', description='The binding ID.

You can call the [BindAxn](https://help.aliyun.com/document_detail/110258.html) operation to obtain the value of SubsId.

This parameter is required.', example='15678890****'),
  trackNo?: string(name='trackNo', description='The tracking number.

This parameter is required.', example='abcde*****'),
}

model AddAxnTrackNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='1A4CADEF-8516-5890-9177-A1A4D97F****'),
}

model AddAxnTrackNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddAxnTrackNoResponseBody(name='body'),
}

/**
 * @summary Adds a tracking number for a private number in the AXN binding.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request AddAxnTrackNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddAxnTrackNoResponse
 */
async function addAxnTrackNoWithOptions(request: AddAxnTrackNoRequest, runtime: Util.RuntimeOptions): AddAxnTrackNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subsId)) {
    query['SubsId'] = request.subsId;
  }
  if (!Util.isUnset(request.trackNo)) {
    query['trackNo'] = request.trackNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddAxnTrackNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds a tracking number for a private number in the AXN binding.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request AddAxnTrackNoRequest
 * @return AddAxnTrackNoResponse
 */
async function addAxnTrackNo(request: AddAxnTrackNoRequest): AddAxnTrackNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return addAxnTrackNoWithOptions(request, runtime);
}

model AddSecretBlacklistRequest {
  blackNo?: string(name='BlackNo', description='The numbers in the blacklist. A point-to-point blacklist has a pair of numbers separated by a colon (:). A number pool blacklist has only one single number.

>  The asterisks (\\\\*) in the sample value are not wildcards.

This parameter is required.', example='1825638****:1825248****'),
  blackType?: string(name='BlackType', description='The blacklist type. Valid values:

*   **POINT_TO_POINT_BLACK**: point-to-point blacklist.
*   **PARTNER_GLOBAL_NUMBER_BLACK**: number pool blacklist.

This parameter is required.', example='POINT_TO_POINT_BLACK'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the Number Pool Management page.

This parameter is required.', example='FC2235****'),
  remark?: string(name='Remark', description='The blacklist remarks.', example='Customer service feedback'),
  wayControl?: string(name='WayControl', description='The control on the call direction.

*   **PHONEA_REJECT**: The first number in the blacklist can be used to call the second number, but the second number cannot be used to call the first number.
*   **PHONEB_REJECT**: The first number in the blacklist cannot be used to call the second number, but the second number can be used to call the first number.
*   If this parameter is left empty, the two numbers in the blacklist cannot be used to call each other.

>  This parameter is available only for a point-to-point blacklist.

Valid values:

*   DUPLEX_REJECT
*   PHONEA_REJECT
*   PHONEB_REJECT', example='PHONEA_REJECT'),
}

model AddSecretBlacklistResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model AddSecretBlacklistResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddSecretBlacklistResponseBody(name='body'),
}

/**
 * @summary Adds a blacklist.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request AddSecretBlacklistRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddSecretBlacklistResponse
 */
async function addSecretBlacklistWithOptions(request: AddSecretBlacklistRequest, runtime: Util.RuntimeOptions): AddSecretBlacklistResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackNo)) {
    query['BlackNo'] = request.blackNo;
  }
  if (!Util.isUnset(request.blackType)) {
    query['BlackType'] = request.blackType;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.wayControl)) {
    query['WayControl'] = request.wayControl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddSecretBlacklist',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds a blacklist.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request AddSecretBlacklistRequest
 * @return AddSecretBlacklistResponse
 */
async function addSecretBlacklist(request: AddSecretBlacklistRequest): AddSecretBlacklistResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSecretBlacklistWithOptions(request, runtime);
}

model BindAXBCallRequest {
  authId?: string(name='AuthId', description='authId绑定关系BX唯一id

This parameter is required.', example='12353'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  expiration?: long(name='Expiration', description='绑定关系过期失效时间： 取值必须大于0； 单位：秒，ct_time + expiration = 自动解绑时间

This parameter is required.', example='7200'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  telA?: string(name='TelA', description='客户A号码

This parameter is required.', example='13*******43'),
  userData?: string(name='UserData', description='客户自定义参数回调带回', example='000'),
}

model BindAXBCallResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    bindId?: string(name='BindId', description='绑定关系ID', example='476567566'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
}

model BindAXBCallResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAXBCallResponseBody(name='body'),
}

/**
 * @summary 调用本接口向工作号平台请求为员工B的工作号X建立呼叫绑定（B，X，A），允许B通过X呼叫客户A
 *
 * @param request BindAXBCallRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAXBCallResponse
 */
async function bindAXBCallWithOptions(request: BindAXBCallRequest, runtime: Util.RuntimeOptions): BindAXBCallResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authId)) {
    query['AuthId'] = request.authId;
  }
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAXBCall',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 调用本接口向工作号平台请求为员工B的工作号X建立呼叫绑定（B，X，A），允许B通过X呼叫客户A
 *
 * @param request BindAXBCallRequest
 * @return BindAXBCallResponse
 */
async function bindAXBCall(request: BindAXBCallRequest): BindAXBCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAXBCallWithOptions(request, runtime);
}

model BindAxbRequest {
  ASRModelId?: string(name='ASRModelId', description='The ID of the ASR model. On the [Automatic Speech Recognition (ASR) Model Management](https://dyplsnext.console.aliyun.com/?spm=5176.12818093.categories-n-products.ddypls.22e616d0a0tEFC#/asr) page, you can view the ID of the ASR model.', example='7ee372834d2f4cc7ac0d0ab2d0ae1aac'),
  ASRStatus?: boolean(name='ASRStatus', description='Specifies whether to enable automatic speech recognition (ASR). Valid values:

*   **false** (default): disables ASR.
*   **true**: enables ASR.', example='false'),
  callDisplayType?: int32(name='CallDisplayType', description='Re-sets the phone number display logic in the AXB binding. Fixed value: **1**, indicating that phone number X is displayed on both the calling phone and the called phone.

>  Due to the regulatory restrictions imposed by carriers, the setting to display real phone numbers during calls does not take effect.', example='1'),
  callRestrict?: string(name='CallRestrict', description='The status of the one-way call restriction. Valid values:

*   **CONTROL_AX_DISABLE**: Phone number A cannot be used to call phone number X.
*   **CONTROL_BX_DISABLE**: Phone number B cannot be used to call phone number X.', example='CONTROL_AX_DISABLE'),
  callTimeout?: int32(name='CallTimeout', description='The maximum ringing duration for each number in sequential ringing. Unit: seconds. The value ranges from 5 to 20.', example='10'),
  dtmfConfig?: string(name='DtmfConfig', description='Specifies the dual tone multiple frequency (DTMF) key configuration in the AXB binding. The following content can be configured:

*   endCallIvrPhoneNo: for whom the audio is played, user A or user B.
*   waitingDtmfTime: the maximum waiting time after the first audio is played. The maximum waiting time is 30 seconds.
*   maxLoop: the maximum number of loop playback times of the first audio if the DTMF key is not matched. The maximum number of loop playback times is 5.
*   step1File: the name of the first audio.
*   step2File: the name of the second audio.
*   validKey: the valid key values, such as 1,2. Only two valid key values can be set, and the key values are separated by a comma (,).
*   waitingEndCall: The waiting duration to hang up a call. The waiting duration is allowed by a carrier. The maximum waiting duration is 10 seconds.', example='{
    "endCallIvrPhoneNo":"A",
    "waitingDtmfTime":10,
    "maxLoop":3,
    "step1File":"62ab72f8-4750-4234-859e-e8d678c0cad3-flow_tts_test_1.wav",
    "step2File":"62ab72f8-4750-4234-859e-e8d678c0cad3-flow_tts_test_2.wav",
    "validKey":"1,2",
    "waitingEndCall":2
}'),
  expectCity?: string(name='ExpectCity', description='Specifies the city to which phone number X to be selected belongs.

*   If no phone number for the specified city is available in the current phone number pool or this parameter is not specified, a phone number that belongs to another city is randomly selected from the current phone number pool and assigned as phone number X.
*   If**Number X Assignment Mode** is set to **Strict Matching Mode** and no phone number meets the requirement, the system displays an allocation error.', example='hangzhou'),
  expiration?: string(name='Expiration', description='The expiration time of the AXB binding.

>  The expiration time must be more than 1 minute later than the time when you call this API operation.

This parameter is required.', example='2021-09-05 12:00:00'),
  isRecordingEnabled?: boolean(name='IsRecordingEnabled', description='Specifies whether to record all calls made by the bound phone numbers. Valid values:

*   **true**
*   **false** (default)', example='true'),
  outId?: string(name='OutId', description='The extension field for the external business. This parameter is returned in a call record receipt.', example='abcdef'),
  outOrderId?: string(name='OutOrderId', description='The ID of the external business.', example='34553330****'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='Phone number A in the AXB binding.

Phone number A can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.

This parameter is required.', example='139****0000'),
  phoneNoB?: string(name='PhoneNoB', description='Phone number B in the AXB binding. If phone number A is used to call phone number X, the call is forwarded to phone number B. Phone number B can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.

>  If you need to update phone number B, call the [UpdateSubscription](https://help.aliyun.com/document_detail/110253.html) operation.', example='139****0000'),
  phoneNoX?: string(name='PhoneNoX', description='Phone number X in the AXB binding.

Phone number X is the phone number that you purchased in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) or by using the [BuySecretNo](https://help.aliyun.com/document_detail/110266.html) operation before you bind a phone number. Phone number X is used to forward calls.

If you do not specify this parameter, a random phone number is selected from the phone number pool based on the value of the ExpectCity parameter and is used as phone number X.', example='139****0000'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.', example='FC5526*****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ringConfig?: string(name='RingConfig', description='Sets the ringtone code for enterprise Color Ring Back Tone (CRBT) in the AXB binding.

*   Ringtone setting when phone number A is used to call phone number X in the AXB binding: AXBRing_A
*   Ringtone setting when phone number B is used to call phone number X in the AXB binding: AXBRing_B

Enterprise CRBT codes: Enterprise CRBT codes can be queried in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account). You can choose **Number Pool Management** > **Enterprise CRBT Management** to view enterprise CRBT codes. You can also upload, delete, or perform other operations on enterprise CRBT codes.

>  The bound enterprise CRBTs are preferentially used. If no enterprise CRBT is set or the setting does not take effect, the enterprise CRBTs at the phone number pool level are used.', example='{"AXBRing_B":"1000****1","AXBRing_A":"1000****1"}'),
}

model BindAxbResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='9297B722-A016-43FB-B51A-E54050D9369D'),
  secretBindDTO?: {
    extension?: string(name='Extension', description='The extension of the phone number.

>  The BindAxb operation does not involve an extension. Ignore this parameter.', example='130'),
    secretNo?: string(name='SecretNo', description='The private number, that is, phone number X.', example='139****0000'),
    subsId?: string(name='SubsId', description='The binding ID.', example='1**************3'),
  }(name='SecretBindDTO', description='The information returned after the phone numbers were bound.'),
}

model BindAxbResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxbResponseBody(name='body'),
}

/**
 * @summary Adds an AXB binding.
 *
 * @description Before you add an AXB binding, we recommend that you specify role A and role B in the AXB device certificate (ProductKey, DeviceName, and DeviceSecret) in your business scenario. For example, in a taxi-hailing scenario, role A is the passenger and role B is the driver.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request BindAxbRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxbResponse
 */
async function bindAxbWithOptions(request: BindAxbRequest, runtime: Util.RuntimeOptions): BindAxbResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ASRModelId)) {
    query['ASRModelId'] = request.ASRModelId;
  }
  if (!Util.isUnset(request.ASRStatus)) {
    query['ASRStatus'] = request.ASRStatus;
  }
  if (!Util.isUnset(request.callDisplayType)) {
    query['CallDisplayType'] = request.callDisplayType;
  }
  if (!Util.isUnset(request.callRestrict)) {
    query['CallRestrict'] = request.callRestrict;
  }
  if (!Util.isUnset(request.callTimeout)) {
    query['CallTimeout'] = request.callTimeout;
  }
  if (!Util.isUnset(request.dtmfConfig)) {
    query['DtmfConfig'] = request.dtmfConfig;
  }
  if (!Util.isUnset(request.expectCity)) {
    query['ExpectCity'] = request.expectCity;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.isRecordingEnabled)) {
    query['IsRecordingEnabled'] = request.isRecordingEnabled;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.outOrderId)) {
    query['OutOrderId'] = request.outOrderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.phoneNoB)) {
    query['PhoneNoB'] = request.phoneNoB;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ringConfig)) {
    query['RingConfig'] = request.ringConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxb',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds an AXB binding.
 *
 * @description Before you add an AXB binding, we recommend that you specify role A and role B in the AXB device certificate (ProductKey, DeviceName, and DeviceSecret) in your business scenario. For example, in a taxi-hailing scenario, role A is the passenger and role B is the driver.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request BindAxbRequest
 * @return BindAxbResponse
 */
async function bindAxb(request: BindAxbRequest): BindAxbResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxbWithOptions(request, runtime);
}

model BindAxbFixedLineRequest {
  anucode?: string(name='Anucode', description='主叫侧放音编码，AXB业务时必须设置。  放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3

This parameter is required.', example='1,2,3'),
  anucodecalled?: string(name='Anucodecalled', description='接通后被叫侧放音编码,接通后被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,B被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，B号码为被叫侧接听时的放音编号为2。', example='示例值示例值'),
  appId?: string(name='AppId', description='应用id

This parameter is required.', example='ALPT_1234'),
  areacode?: string(name='Areacode', description='区号,去掉“0” 例如：北京（10）；在平台分配X号码模式中，平台从号码池中分配该地区的X号码，避免产生呼叫长途费。', example='10'),
  bindType?: string(name='BindType', description='绑定类型，值如下： mode101：客户携带X号码 mode102：平台分配X号码

This parameter is required.', example='示例值示例值'),
  expiration?: string(name='Expiration', description='过期时间,单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期

This parameter is required.', example='10'),
  extra?: {
    callrecording?: string(name='Callrecording', description='录音控制，默认是0（不开通录音功能）。 0：不录音 1：录音', example='示例值示例值'),
  }(name='Extra', description='扩展参数'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='15433678436'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，不能超过100个长度', example='remark'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subts?: string(name='Subts', description='绑定时间，格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20161114143116'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧的放音编码,接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,B被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，B号码为被叫时主叫侧的放音编号为2。', example='示例值示例值示例值'),
  telA?: string(name='TelA', description='真实号码

This parameter is required.', example='18456713271'),
  telB?: string(name='TelB', description='对端号码

This parameter is required.', example='18971362645'),
  telX?: string(name='TelX', description='X号码； 平台分配号码模式下，该参数可不带，系统忽略该参数  格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。', example='19767562345'),
  ts?: string(name='Ts', description='业务时间戳，格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20161114143116001'),
}

model BindAxbFixedLineShrinkRequest {
  anucode?: string(name='Anucode', description='主叫侧放音编码，AXB业务时必须设置。  放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3

This parameter is required.', example='1,2,3'),
  anucodecalled?: string(name='Anucodecalled', description='接通后被叫侧放音编码,接通后被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,B被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，B号码为被叫侧接听时的放音编号为2。', example='示例值示例值'),
  appId?: string(name='AppId', description='应用id

This parameter is required.', example='ALPT_1234'),
  areacode?: string(name='Areacode', description='区号,去掉“0” 例如：北京（10）；在平台分配X号码模式中，平台从号码池中分配该地区的X号码，避免产生呼叫长途费。', example='10'),
  bindType?: string(name='BindType', description='绑定类型，值如下： mode101：客户携带X号码 mode102：平台分配X号码

This parameter is required.', example='示例值示例值'),
  expiration?: string(name='Expiration', description='过期时间,单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期

This parameter is required.', example='10'),
  extraShrink?: string(name='Extra', description='扩展参数'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='15433678436'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，不能超过100个长度', example='remark'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subts?: string(name='Subts', description='绑定时间，格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20161114143116'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧的放音编码,接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,B被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，B号码为被叫时主叫侧的放音编号为2。', example='示例值示例值示例值'),
  telA?: string(name='TelA', description='真实号码

This parameter is required.', example='18456713271'),
  telB?: string(name='TelB', description='对端号码

This parameter is required.', example='18971362645'),
  telX?: string(name='TelX', description='X号码； 平台分配号码模式下，该参数可不带，系统忽略该参数  格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。', example='19767562345'),
  ts?: string(name='Ts', description='业务时间戳，格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20161114143116001'),
}

model BindAxbFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', description='响应码 0-成功', example='0'),
  data?: {
    subid?: string(name='Subid', description='绑定id', example='示例值'),
    telX?: string(name='TelX', description='X号码', example='示例值'),
  }(name='Data', description='响应内容'),
  message?: string(name='Message', description='响应消息', example='success'),
  requestId?: string(name='RequestId', example='649E9EB5-9436-53CF-B41A-C4F0433212E7'),
  success?: boolean(name='Success', description='是否处理成功  true-成功', example='true'),
}

model BindAxbFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxbFixedLineResponseBody(name='body'),
}

/**
 * @summary 固话AxB绑定
 *
 * @param tmpReq BindAxbFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxbFixedLineResponse
 */
async function bindAxbFixedLineWithOptions(tmpReq: BindAxbFixedLineRequest, runtime: Util.RuntimeOptions): BindAxbFixedLineResponse {
  Util.validateModel(tmpReq);
  var request = new BindAxbFixedLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.anucode)) {
    query['Anucode'] = request.anucode;
  }
  if (!Util.isUnset(request.anucodecalled)) {
    query['Anucodecalled'] = request.anucodecalled;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.areacode)) {
    query['Areacode'] = request.areacode;
  }
  if (!Util.isUnset(request.bindType)) {
    query['BindType'] = request.bindType;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extraShrink)) {
    query['Extra'] = request.extraShrink;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subts)) {
    query['Subts'] = request.subts;
  }
  if (!Util.isUnset(request.TAnucodeConnect)) {
    query['TAnucodeConnect'] = request.TAnucodeConnect;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.telB)) {
    query['TelB'] = request.telB;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxbFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 固话AxB绑定
 *
 * @param request BindAxbFixedLineRequest
 * @return BindAxbFixedLineResponse
 */
async function bindAxbFixedLine(request: BindAxbFixedLineRequest): BindAxbFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxbFixedLineWithOptions(request, runtime);
}

model BindAxgRequest {
  ASRModelId?: string(name='ASRModelId', description='The ID of the ASR model.', example='980abddb908f48e8b987cb2cd303****'),
  ASRStatus?: boolean(name='ASRStatus', description='Specifies whether to enable automatic speech recognition (ASR). Valid values:

*   **False** (default): disables ASR.
*   **True**: enables ASR.', example='False'),
  callDisplayType?: int32(name='CallDisplayType', description='Re-sets the phone number display logic in the AXG binding. Fixed value: **1**, indicating that phone number X is displayed on both the calling phone and the called phone.

>  Due to the regulatory restrictions imposed by carriers, the setting to display real phone numbers during calls does not take effect.', example='1'),
  callRestrict?: string(name='CallRestrict', description='The status of call restrictions. Valid values:

*   **CONTROL_AX_DISABLE**: Phone number A cannot be used to call phone number X.
*   **CONTROL_BX_DISABLE**: Phone number B cannot be used to call phone number X.', example='CONTROL_AX_DISABLE'),
  expectCity?: string(name='ExpectCity', description='Specifies the city to which phone number X to be selected belongs.

*   If no phone number for the specified city is available in the current phone number pool or this parameter is not specified, a phone number that belongs to another city is randomly selected from the current phone number pool and assigned as phone number X.
*   If Number X Assignment Mode is set to Strict Matching Mode and no phone number meets the requirement, the system displays an allocation error.', example='hangzhou'),
  expiration?: string(name='Expiration', description='The expiration time of the AXG binding. The value is accurate to seconds.

>  The expiration time must be more than 1 minute later than the time when you call this API operation.

This parameter is required.', example='2019-09-05 12:00:00'),
  groupId?: string(name='GroupId', description='The group ID in the AXG binding. You can view the group ID by using either of the following methods:

*   On the **Number Pool Management** page in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account), filter AXG privacy numbers and click **Number Group G Management** to view the group IDs of number groups G.****
*   If the [CreateAxgGroup](https://help.aliyun.com/document_detail/110250.html) operation is called to create number group G, the value of **GroupId** in the response of the CreateAxgGroup operation is specified as the value of the request parameter **GroupId** of the BindAxg operation.

>  Number group G must have one or more phone numbers.

This parameter is required.', example='1234'),
  isRecordingEnabled?: boolean(name='IsRecordingEnabled', description='Specifies whether to record all calls made by the bound phone numbers.', example='true'),
  outId?: string(name='OutId', description='The extension field for the external business. This parameter is returned in a call record receipt.', example='abcdef'),
  outOrderId?: string(name='OutOrderId', description='The ID of the external business.', example='abcdef'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='Phone number A in the AXG binding. Phone number A can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.

This parameter is required.', example='139****0000'),
  phoneNoB?: string(name='PhoneNoB', description='Phone number B in the AXG binding. If phone number A is used to call phone number X, the call is forwarded to phone number B. If you need to update phone number B, call the [UpdateSubscription](https://help.aliyun.com/document_detail/110253.html) operation.

Phone number B can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.', example='139****0000'),
  phoneNoX?: string(name='PhoneNoX', description='Phone number X in the AXG binding. If you do not specify this parameter, a random phone number is selected from the phone number pool based on the value of the **ExpectCity** parameter and is used as phone number X.

>  Phone number X is the phone number that you purchased in the Phone Number Protection console or by using the [BuySecretNo](https://help.aliyun.com/document_detail/110266.html) operation before you bind a phone number. Phone number X is used to forward calls.', example='139****0000'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.', example='FC123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ringConfig?: string(name='RingConfig', description='Sets the ringtone for enterprise Color Ring Back Tone (CRBT) in the AXG binding.

*   Ringtone setting (with a callback number) when phone number A is used to call phone number X in the AXG binding: AXGRing_AB
*   Ringtone setting (without a callback number) when phone number A is used to call phone number X in the AXG binding: AXGRing_A
*   Ringtone setting when a phone number in number group G is used to call phone number X in the AXG binding: AXGRing_G
*   Enterprise CRBT codes: Enterprise CRBT codes can be queried in the Phone Number Protection console. You can choose **Number Pool Management > Enterprise CRBT Management** to view and manage enterprise CRBT codes. You can also upload, delete, or perform other operations on enterprise CRBT codes.

>  The bound enterprise CRBTs are preferentially used. If no enterprise CRBT is set or the setting does not take effect, the enterprise CRBTs at the phone number pool level are used.', example='{"AXGRing_AB":"100000001","AXGRing_A":"100000002","AXGRing_G":"100000003"}'),
}

model BindAxgResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
  secretBindDTO?: {
    extension?: string(name='Extension', description='The extension of the phone number.

>  The BindAxg operation does not involve an extension. Ignore this parameter.', example='139****0000'),
    secretNo?: string(name='SecretNo', description='The private number, that is, phone number X.', example='139****0000'),
    subsId?: string(name='SubsId', description='The binding ID.', example='1************3'),
  }(name='SecretBindDTO', description='The information returned after the phone numbers were bound.'),
}

model BindAxgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxgResponseBody(name='body'),
}

/**
 * @summary Adds an AXG binding.
 *
 * @description An AXG protection solution can be configured to meet the requirements for grading users, limiting the scope of calls, and restricting order snatching. The letter G represents a phone number group to which you can add phone numbers as needed.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request BindAxgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxgResponse
 */
async function bindAxgWithOptions(request: BindAxgRequest, runtime: Util.RuntimeOptions): BindAxgResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ASRModelId)) {
    query['ASRModelId'] = request.ASRModelId;
  }
  if (!Util.isUnset(request.ASRStatus)) {
    query['ASRStatus'] = request.ASRStatus;
  }
  if (!Util.isUnset(request.callDisplayType)) {
    query['CallDisplayType'] = request.callDisplayType;
  }
  if (!Util.isUnset(request.callRestrict)) {
    query['CallRestrict'] = request.callRestrict;
  }
  if (!Util.isUnset(request.expectCity)) {
    query['ExpectCity'] = request.expectCity;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.isRecordingEnabled)) {
    query['IsRecordingEnabled'] = request.isRecordingEnabled;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.outOrderId)) {
    query['OutOrderId'] = request.outOrderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.phoneNoB)) {
    query['PhoneNoB'] = request.phoneNoB;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ringConfig)) {
    query['RingConfig'] = request.ringConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxg',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds an AXG binding.
 *
 * @description An AXG protection solution can be configured to meet the requirements for grading users, limiting the scope of calls, and restricting order snatching. The letter G represents a phone number group to which you can add phone numbers as needed.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request BindAxgRequest
 * @return BindAxgResponse
 */
async function bindAxg(request: BindAxgRequest): BindAxgResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxgWithOptions(request, runtime);
}

model BindAxnRequest {
  ASRModelId?: string(name='ASRModelId', description='The ID of the ASR model. On the [Automatic Speech Recognition (ASR) Model Management](https://dyplsnext.console.aliyun.com/?spm=5176.12818093.categories-n-products.ddypls.22e616d0a0tEFC#/asr) page, you can view the ID of the ASR model.', example='7ee372834d2f4cc7ac0d0ab2d0ae1aac'),
  ASRStatus?: boolean(name='ASRStatus', description='Specifies whether to enable automatic speech recognition (ASR). Valid values:

*   **false** (default): disables ASR.
*   **true**: enables ASR.', example='true'),
  callDisplayType?: int32(name='CallDisplayType', description='Re-sets the phone number display logic in the AXN binding. Fixed value: **1**, indicating that phone number X is displayed on both the calling phone and the called phone.

>  Due to the regulatory restrictions imposed by carriers, the setting to display real phone numbers during calls does not take effect.', example='1'),
  callRestrict?: string(name='CallRestrict', description='The status of one-way call restrictions. Valid values:

*   **CONTROL_AX_DISABLE**: Phone number A cannot be used to call phone number X.
*   **CONTROL_BX_DISABLE**: Phone number B cannot be used to call phone number X.', example='CONTROL_AX_DISABLE'),
  callTimeout?: int32(name='CallTimeout', description='The maximum ringing duration for each number in sequential ringing. Unit: seconds.', example='10'),
  expectCity?: string(name='ExpectCity', description='Specifies the city to which phone number X to be selected belongs.

*   If no phone number for the specified city is available in the current phone number pool or this parameter is not specified, a phone number that belongs to another city is randomly selected from the current phone number pool and assigned as phone number X.
*   If **Number X Assignment Mode** is set to **Strict Matching Mode** and no phone number meets the requirement, the system displays an allocation error.', example='hangzhou'),
  expiration?: string(name='Expiration', description='The expiration time of the AXN binding. Unit: seconds.

>  The expiration time must be more than 60 seconds later than the time when you call this API operation.

This parameter is required.', example='2021-09-05 12:00:00'),
  extend?: string(name='Extend'),
  isRecordingEnabled?: boolean(name='IsRecordingEnabled', description='Specifies whether to record all calls made by the bound phone numbers. Valid values:

*   **true**
*   **false** (default)', example='true'),
  noType?: string(name='NoType', description='The type of the phone number.

>  This parameter is applicable to the key accounts of Alibaba Cloud. This parameter can be ignored for Alibaba Cloud users.', example='AXB_170'),
  outId?: string(name='OutId', description='The extension field for the external business. This parameter is returned in a call record receipt.', example='abcdef'),
  outOrderId?: string(name='OutOrderId', description='The ID of the external business.', example='34553330****'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='Phone number A in the AXN binding. Phone number A can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.

This parameter is required.', example='139****0000'),
  phoneNoB?: string(name='PhoneNoB', description='Phone number B in the AXN binding. If phone number A is used to call phone number X, the call is forwarded to phone number B. Phone number B can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.

>  If phone number B is not specified in the AXN binding, the system automatically generates a nonexistent number. If phone number A is used to call phone number X, the nonexistent number is returned. If you need to update phone number B, call the [UpdateSubscription](https://help.aliyun.com/document_detail/110253.html) operation.', example='138****0000'),
  phoneNoX?: string(name='PhoneNoX', description='Phone number X in the AXN binding. Phone number X is the phone number that you purchased in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) or by using the [BuySecretNo](https://help.aliyun.com/document_detail/110266.html) operation before you bind a phone number. Phone number X is used to forward calls.

>  If you do not specify this parameter, a random phone number is selected from the phone number pool based on the value of the ExpectCity parameter and is used as phone number X.', example='139****0000'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console ](https://dypls.console.aliyun.com/dypls.htm#/account)and view the key of the phone number pool on the **Number Pool Management** page.', example='FC2256****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ringConfig?: string(name='RingConfig', description='Sets the ringtone code for enterprise Color Ring Back Tone (CRBT) in the AXN extension binding.

*   Ringtone setting (with a callback number) when phone number A is used to call phone number X in the AXN extension binding: AXNRing_AB
*   Ringtone setting (without a callback number) when phone number A is used to call phone number X in the AXN extension binding: AXNRing_A
*   Ringtone setting when an N-side number is used to call phone number X in the AXN extension binding: AXNRing_N

Enterprise CRBT codes: Enterprise CRBT codes can be queried in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account). You can choose **Number Pool Management > Enterprise CRBT Management** to view enterprise CRBT codes. You can also upload, delete, or perform other operations on enterprise CRBT codes.

>  The bound enterprise CRBTs are preferentially used. If no enterprise CRBT is set or the setting does not take effect, the enterprise CRBTs at the phone number pool level are used.', example='{"AXNRing_N":"100000001","AXNRing_A":"100000001"}'),
}

model BindAxnResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
  secretBindDTO?: {
    extension?: string(name='Extension', description='The extension of the phone number.

>  The BindAxn operation does not involve an extension. Ignore this parameter.', example='130'),
    secretNo?: string(name='SecretNo', description='The private number, that is, phone number X.', example='139****0000'),
    subsId?: string(name='SubsId', description='The binding ID.', example='1***************3'),
  }(name='SecretBindDTO', description='The information returned after the phone numbers were bound.'),
}

model BindAxnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxnResponseBody(name='body'),
}

/**
 * @summary Adds an AXN binding.
 *
 * @description >  An AXN private number is a dedicated private number assigned to phone number A. When an N-side number is used to call phone number X, the call is forwarded to phone number A.
 *
 * @param request BindAxnRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxnResponse
 */
async function bindAxnWithOptions(request: BindAxnRequest, runtime: Util.RuntimeOptions): BindAxnResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ASRModelId)) {
    query['ASRModelId'] = request.ASRModelId;
  }
  if (!Util.isUnset(request.ASRStatus)) {
    query['ASRStatus'] = request.ASRStatus;
  }
  if (!Util.isUnset(request.callDisplayType)) {
    query['CallDisplayType'] = request.callDisplayType;
  }
  if (!Util.isUnset(request.callRestrict)) {
    query['CallRestrict'] = request.callRestrict;
  }
  if (!Util.isUnset(request.callTimeout)) {
    query['CallTimeout'] = request.callTimeout;
  }
  if (!Util.isUnset(request.expectCity)) {
    query['ExpectCity'] = request.expectCity;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extend)) {
    query['Extend'] = request.extend;
  }
  if (!Util.isUnset(request.isRecordingEnabled)) {
    query['IsRecordingEnabled'] = request.isRecordingEnabled;
  }
  if (!Util.isUnset(request.noType)) {
    query['NoType'] = request.noType;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.outOrderId)) {
    query['OutOrderId'] = request.outOrderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.phoneNoB)) {
    query['PhoneNoB'] = request.phoneNoB;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ringConfig)) {
    query['RingConfig'] = request.ringConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxn',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds an AXN binding.
 *
 * @description >  An AXN private number is a dedicated private number assigned to phone number A. When an N-side number is used to call phone number X, the call is forwarded to phone number A.
 *
 * @param request BindAxnRequest
 * @return BindAxnResponse
 */
async function bindAxn(request: BindAxnRequest): BindAxnResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxnWithOptions(request, runtime);
}

model BindAxnExtensionRequest {
  ASRModelId?: string(name='ASRModelId', description='The ID of the ASR model. On the [Automatic Speech Recognition (ASR) Model Management](https://dyplsnext.console.aliyun.com/?spm=5176.12818093.categories-n-products.ddypls.22e616d0a0tEFC#/asr) page, you can view the ID of the ASR model.', example='980abddb908f48e8b987cb2cd303****'),
  ASRStatus?: boolean(name='ASRStatus', description='Specifies whether to enable automatic speech recognition (ASR). Valid values:

*   **false** (default): disables ASR.
*   **true**: enables ASR.', example='True'),
  callDisplayType?: int32(name='CallDisplayType', description='Re-sets the phone number display logic in the AXN extension binding. Fixed value: **1**, indicating that phone number X is displayed on both the calling phone and the called phone.

>  Due to the regulatory restrictions imposed by carriers, the setting to display real phone numbers during calls does not take effect.', example='1'),
  callRestrict?: string(name='CallRestrict', description='The status of call restrictions. Valid values:

*   **CONTROL_AX_DISABLE**: Phone number A cannot be used to call phone number X.
*   **CONTROL_BX_DISABLE**: Phone number B cannot be used to call phone number X.', example='CONTROL_AX_DISABLE'),
  expectCity?: string(name='ExpectCity', description='Specifies the city to which phone number X to be selected belongs.

*   If no phone number for the specified city is available in the current phone number pool or this parameter is not specified, a phone number that belongs to another city is randomly selected from the current phone number pool and assigned as phone number X.
*   If Number X Assignment Mode is set to Strict Matching Mode and no phone number meets the requirement, the system displays an allocation error.', example='hangzhou'),
  expiration?: string(name='Expiration', description='The expiration time of the AXN extension binding. The value is accurate to seconds.

>  The expiration time must be more than 1 minute later than the time when you call this API operation.

This parameter is required.', example='2019-09-05 12:00:00'),
  extend?: string(name='Extend'),
  extension?: string(name='Extension', description='The extension of phone number X. The extension is 1 to 3 digits in length.

>  If you specify Extension, you must also specify PhoneNoX.', example='130'),
  isRecordingEnabled?: boolean(name='IsRecordingEnabled', description='Specifies whether to record all calls made by the bound phone numbers. Valid values:

*   **true**
*   **false** (default)', example='true'),
  outId?: string(name='OutId', description='The extension field for the external business. This parameter is returned in a call record receipt.', example='abcdef'),
  outOrderId?: string(name='OutOrderId', description='The ID of the external business.', example='abcdef'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='Phone number A in the AXN extension binding. Phone number A can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.

This parameter is required.', example='139****0000'),
  phoneNoB?: string(name='PhoneNoB', description='Phone number B in the AXN extension binding. When phone number A is used to call phone number X, the call is forwarded to phone number B. If you need to update phone number B, call the [UpdateSubscription](https://help.aliyun.com/document_detail/110253.html) operation.

Phone number B can be set to a mobile phone number or a landline phone number. The landline phone number must be added with an area code, and no hyphen is required between the area code and the landline phone number.', example='139****0000'),
  phoneNoX?: string(name='PhoneNoX', description='Phone number X in the AXN extension binding. If you do not specify this parameter, a random phone number is selected from the phone number pool based on the value of the **ExpectCity** parameter and is used as phone number X.

>  Phone number X is the phone number that you purchased in the Phone Number Protection console or by using the [BuySecretNo](https://help.aliyun.com/document_detail/110266.html) operation before you bind a phone number. Phone number X is used to forward calls.', example='139****0000'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.', example='FC123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ringConfig?: string(name='RingConfig', description='Sets the ringtone for enterprise Color Ring Back Tone (CRBT) in the AXN extension binding.

*   Ringtone setting (with a callback number) when phone number A is used to call phone number X in the AXN extension binding: AXNRing_AB
*   Ringtone setting (without a callback number) when phone number A is used to call phone number X in the AXN extension binding: AXNRing_A
*   Ringtone setting when an N-side number is used to call phone number X in the AXN extension binding: AXNRing_N

Enterprise CRBT codes: Enterprise CRBT codes can be queried in the Phone Number Protection console. You can choose **Number Pool Management > Enterprise CRBT Management** to view and manage enterprise CRBT codes. You can also upload, delete, or perform other operations on enterprise CRBT codes.

>  The bound enterprise CRBTs are preferentially used. If no enterprise CRBT is set or the setting does not take effect, the enterprise CRBTs at the phone number pool level are used.', example='{"AXNRing_N":"100000001","AXNRing_A":"100000001"}'),
}

model BindAxnExtensionResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='9297B722-A016-43FB-B51A-E54050D9369D'),
  secretBindDTO?: {
    extension?: string(name='Extension', description='The extension of the phone number.', example='130'),
    secretNo?: string(name='SecretNo', description='The private number, that is, phone number X.', example='139*****0000'),
    subsId?: string(name='SubsId', description='The binding ID.', example='1***************3'),
  }(name='SecretBindDTO', description='The information returned after the phone numbers were bound.'),
}

model BindAxnExtensionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxnExtensionResponseBody(name='body'),
}

/**
 * @summary Adds an AXN extension binding.
 *
 * @description Before you add an AXN extension binding, confirm phone number A and phone number N in the business scenario. Phone number A belongs to a customer, and phone number X is the private number assigned to the customer. When any other phone number is used to call phone number X and the extension, the call is transferred to phone number A. When phone number A is used to call phone number X, the call is transferred to the default phone number B that is specified during the phone number binding.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request BindAxnExtensionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxnExtensionResponse
 */
async function bindAxnExtensionWithOptions(request: BindAxnExtensionRequest, runtime: Util.RuntimeOptions): BindAxnExtensionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ASRModelId)) {
    query['ASRModelId'] = request.ASRModelId;
  }
  if (!Util.isUnset(request.ASRStatus)) {
    query['ASRStatus'] = request.ASRStatus;
  }
  if (!Util.isUnset(request.callDisplayType)) {
    query['CallDisplayType'] = request.callDisplayType;
  }
  if (!Util.isUnset(request.callRestrict)) {
    query['CallRestrict'] = request.callRestrict;
  }
  if (!Util.isUnset(request.expectCity)) {
    query['ExpectCity'] = request.expectCity;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extend)) {
    query['Extend'] = request.extend;
  }
  if (!Util.isUnset(request.extension)) {
    query['Extension'] = request.extension;
  }
  if (!Util.isUnset(request.isRecordingEnabled)) {
    query['IsRecordingEnabled'] = request.isRecordingEnabled;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.outOrderId)) {
    query['OutOrderId'] = request.outOrderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.phoneNoB)) {
    query['PhoneNoB'] = request.phoneNoB;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ringConfig)) {
    query['RingConfig'] = request.ringConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxnExtension',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds an AXN extension binding.
 *
 * @description Before you add an AXN extension binding, confirm phone number A and phone number N in the business scenario. Phone number A belongs to a customer, and phone number X is the private number assigned to the customer. When any other phone number is used to call phone number X and the extension, the call is transferred to phone number A. When phone number A is used to call phone number X, the call is transferred to the default phone number B that is specified during the phone number binding.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request BindAxnExtensionRequest
 * @return BindAxnExtensionResponse
 */
async function bindAxnExtension(request: BindAxnExtensionRequest): BindAxnExtensionResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxnExtensionWithOptions(request, runtime);
}

model BindAxnExtensionFixedLineRequest {
  anucode?: string(name='Anucode', description='This parameter is required.', example='10001,10002,10003'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  areacode?: string(name='Areacode', description='去掉“0” 例如：北京（10）；在平台分配X号码模式中，平台从号码池中分配该地区的X号码，避免产生呼叫长途费', example='10'),
  bindType?: string(name='BindType', description='绑定类型，值如下： mode101：客户携带X号码 mode102：平台分配X号码

This parameter is required.', example='mode101'),
  expiration?: string(name='Expiration', description='单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期

This parameter is required.', example='60'),
  extraaxx?: {
    callback?: string(name='Callback', description='A通过X呼叫，即A主叫X，仅下列值有效。默认是0。 0：不能外呼 1：接续最近的B号码', example='0'),
    callrecording?: string(name='Callrecording', description='录音控制，仅下列值有效。默认是0（不开通录音功能）。 0：不录音 1：录音', example='1'),
  }(name='Extraaxx', description='额外字段'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='12444'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码

This parameter is required.', example='15500001111放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  AXN分机号业务的放音编码,B->X和其他号码->X的编码一致  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3'),
  telX?: string(name='TelX', description='X号码；平台分配号码模式下，该参数可不带，系统忽略该参数', example='0571409312'),
  telXext?: string(name='TelXext', description='分机号；平台分配号码模式下，该参数可不带，系统忽略该参数', example='1009'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model BindAxnExtensionFixedLineShrinkRequest {
  anucode?: string(name='Anucode', description='This parameter is required.', example='10001,10002,10003'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  areacode?: string(name='Areacode', description='去掉“0” 例如：北京（10）；在平台分配X号码模式中，平台从号码池中分配该地区的X号码，避免产生呼叫长途费', example='10'),
  bindType?: string(name='BindType', description='绑定类型，值如下： mode101：客户携带X号码 mode102：平台分配X号码

This parameter is required.', example='mode101'),
  expiration?: string(name='Expiration', description='单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期

This parameter is required.', example='60'),
  extraaxxShrink?: string(name='Extraaxx', description='额外字段'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='12444'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码

This parameter is required.', example='15500001111放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  AXN分机号业务的放音编码,B->X和其他号码->X的编码一致  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3'),
  telX?: string(name='TelX', description='X号码；平台分配号码模式下，该参数可不带，系统忽略该参数', example='0571409312'),
  telXext?: string(name='TelXext', description='分机号；平台分配号码模式下，该参数可不带，系统忽略该参数', example='1009'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model BindAxnExtensionFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', description='响应码 0：成功，其它失败，具体见文档', example='0'),
  data?: {
    subid?: string(name='Subid', description='绑定id', example='GHX0534X202504221531579290029'),
    telX?: string(name='TelX', description='隐私号码', example='0571409312'),
    telXext?: string(name='TelXext', description='分机号，只有4位', example='1001'),
  }(name='Data', description='响应信息'),
  message?: string(name='Message', description='描述信息', example='success'),
  requestId?: string(name='RequestId', example='AE2D6997-643A-59CB-9B3C-918572E5CEAA'),
  success?: string(name='Success', example='true'),
}

model BindAxnExtensionFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxnExtensionFixedLineResponseBody(name='body'),
}

/**
 * @summary AXN分机号-号码绑定
 *
 * @param tmpReq BindAxnExtensionFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxnExtensionFixedLineResponse
 */
async function bindAxnExtensionFixedLineWithOptions(tmpReq: BindAxnExtensionFixedLineRequest, runtime: Util.RuntimeOptions): BindAxnExtensionFixedLineResponse {
  Util.validateModel(tmpReq);
  var request = new BindAxnExtensionFixedLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extraaxx)) {
    request.extraaxxShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extraaxx, 'Extraaxx', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.anucode)) {
    query['Anucode'] = request.anucode;
  }
  if (!Util.isUnset(request.anucodecalled)) {
    query['Anucodecalled'] = request.anucodecalled;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.areacode)) {
    query['Areacode'] = request.areacode;
  }
  if (!Util.isUnset(request.bindType)) {
    query['BindType'] = request.bindType;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extraaxxShrink)) {
    query['Extraaxx'] = request.extraaxxShrink;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subts)) {
    query['Subts'] = request.subts;
  }
  if (!Util.isUnset(request.TAnucodeConnect)) {
    query['TAnucodeConnect'] = request.TAnucodeConnect;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  if (!Util.isUnset(request.telXext)) {
    query['TelXext'] = request.telXext;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxnExtensionFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AXN分机号-号码绑定
 *
 * @param request BindAxnExtensionFixedLineRequest
 * @return BindAxnExtensionFixedLineResponse
 */
async function bindAxnExtensionFixedLine(request: BindAxnExtensionFixedLineRequest): BindAxnExtensionFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxnExtensionFixedLineWithOptions(request, runtime);
}

model BindAxnFixedLineRequest {
  anucode?: string(name='Anucode', description='放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3

This parameter is required.', example='10001,10002,10003'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  areacode?: string(name='Areacode', description='去掉“0” 例如：北京（10）；在平台分配X号码模式中，平台从号码池中分配该地区的X号码，避免产生呼叫长途费', example='10'),
  bindType?: string(name='BindType', description='绑定类型，值如下： mode101：客户携带X号码 mode102：平台分配X号码

This parameter is required.', example='mode101'),
  expiration?: string(name='Expiration', description='位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期

This parameter is required.', example='示例值'),
  extra?: {
    callback?: string(name='Callback', description='A通过X呼叫，即A主叫X，仅下列值有效。默认是0。 0：不能外呼 1：接续最近的N号码 2：回拨固定号码：telB', example='0'),
    callrecording?: string(name='Callrecording', description='仅下列值有效。默认是0（不开通录音功能）。 0：不录音 1：录音', example='0'),
  }(name='Extra', description='扩展参数'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='12444'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723098'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码被叫为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码

This parameter is required.', example='15500001111'),
  telB?: string(name='TelB', description='N号码', example='15500002222'),
  telX?: string(name='TelX', description='X号码； 平台分配号码模式下，该参数可不带，系统忽略该参数', example='0571409312'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model BindAxnFixedLineShrinkRequest {
  anucode?: string(name='Anucode', description='放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3

This parameter is required.', example='10001,10002,10003'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  areacode?: string(name='Areacode', description='去掉“0” 例如：北京（10）；在平台分配X号码模式中，平台从号码池中分配该地区的X号码，避免产生呼叫长途费', example='10'),
  bindType?: string(name='BindType', description='绑定类型，值如下： mode101：客户携带X号码 mode102：平台分配X号码

This parameter is required.', example='mode101'),
  expiration?: string(name='Expiration', description='位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期

This parameter is required.', example='示例值'),
  extraShrink?: string(name='Extra', description='扩展参数'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='12444'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723098'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码被叫为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码

This parameter is required.', example='15500001111'),
  telB?: string(name='TelB', description='N号码', example='15500002222'),
  telX?: string(name='TelX', description='X号码； 平台分配号码模式下，该参数可不带，系统忽略该参数', example='0571409312'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model BindAxnFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  code?: string(name='Code', description='响应码 0：成功，其它失败，具体见文档', example='0'),
  data?: {
    subid?: string(name='Subid', description='绑定id', example='GHX0534X202504221531579290029-2-1-aliaxn'),
    telX?: string(name='TelX', description='隐私号码', example='0571409312'),
  }(name='Data'),
  message?: string(name='Message', description='描述信息', example='success'),
  requestId?: string(name='RequestId', example='4D690962-08CE-5D38-A65A-AB247D7DF7A2'),
  success?: boolean(name='Success', example='true'),
}

model BindAxnFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindAxnFixedLineResponseBody(name='body'),
}

/**
 * @summary AXN模式绑定，分配X号码
 *
 * @param tmpReq BindAxnFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindAxnFixedLineResponse
 */
async function bindAxnFixedLineWithOptions(tmpReq: BindAxnFixedLineRequest, runtime: Util.RuntimeOptions): BindAxnFixedLineResponse {
  Util.validateModel(tmpReq);
  var request = new BindAxnFixedLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.anucode)) {
    query['Anucode'] = request.anucode;
  }
  if (!Util.isUnset(request.anucodecalled)) {
    query['Anucodecalled'] = request.anucodecalled;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.areacode)) {
    query['Areacode'] = request.areacode;
  }
  if (!Util.isUnset(request.bindType)) {
    query['BindType'] = request.bindType;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extraShrink)) {
    query['Extra'] = request.extraShrink;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subts)) {
    query['Subts'] = request.subts;
  }
  if (!Util.isUnset(request.TAnucodeConnect)) {
    query['TAnucodeConnect'] = request.TAnucodeConnect;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.telB)) {
    query['TelB'] = request.telB;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindAxnFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary AXN模式绑定，分配X号码
 *
 * @param request BindAxnFixedLineRequest
 * @return BindAxnFixedLineResponse
 */
async function bindAxnFixedLine(request: BindAxnFixedLineRequest): BindAxnFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindAxnFixedLineWithOptions(request, runtime);
}

model BindBatchAxgRequest {
  axgBindList?: [ 
    {
      ASRModelId?: string(name='ASRModelId', example='7ee372834d2f4cc7ac0d0ab2d0ae1aac'),
      ASRStatus?: boolean(name='ASRStatus', example='true'),
      callDisplayType?: int32(name='CallDisplayType', example='1'),
      callRestrict?: string(name='CallRestrict', example='CONTROL_AX_DISABLE'),
      expectCity?: string(name='ExpectCity'),
      expiration?: string(name='Expiration', example='2022-07-11 01:05:15'),
      groupId?: string(name='GroupId', description='This parameter is required.', example='1234'),
      isRecordingEnabled?: boolean(name='IsRecordingEnabled', example='False'),
      outId?: string(name='OutId', example='18223ad447910fd'),
      outOrderId?: string(name='OutOrderId', example='20220824021816883677'),
      phoneNoA?: string(name='PhoneNoA', description='This parameter is required.', example='13333333333'),
      phoneNoB?: string(name='PhoneNoB', example='13333333333'),
      phoneNoX?: string(name='PhoneNoX', example='13333333333'),
      ringConfig?: string(name='RingConfig', example='{\\\\"AXBRing_B\\\\":\\\\"100000002\\\\",\\\\"AXBRing_A\\\\":\\\\"100000001\\\\"}'),
    }
  ](name='AxgBindList', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', example='FC2235****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model BindBatchAxgShrinkRequest {
  axgBindListShrink?: string(name='AxgBindList', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', example='FC2235****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model BindBatchAxgResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='5DCCA8CD-6C0A-50B4-A496-B1D2AB48A1C3'),
  secretBindList?: {
    secretBind?: [ 
    {
      code?: string(name='Code', example='isv.INVALID_PARAMETERS'),
      extension?: string(name='Extension', example='257'),
      groupId?: string(name='GroupId', example='1234'),
      message?: string(name='Message', example='ringConfig invalid'),
      phoneNoA?: string(name='PhoneNoA', example='13333333333'),
      secretNo?: string(name='SecretNo', example='13333333333'),
      subsId?: string(name='SubsId', example='1000085060515673'),
    }
  ](name='SecretBind')
  }(name='SecretBindList'),
}

model BindBatchAxgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindBatchAxgResponseBody(name='body'),
}

/**
 * @param tmpReq BindBatchAxgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindBatchAxgResponse
 */
async function bindBatchAxgWithOptions(tmpReq: BindBatchAxgRequest, runtime: Util.RuntimeOptions): BindBatchAxgResponse {
  Util.validateModel(tmpReq);
  var request = new BindBatchAxgShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.axgBindList)) {
    request.axgBindListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.axgBindList, 'AxgBindList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.axgBindListShrink)) {
    query['AxgBindList'] = request.axgBindListShrink;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindBatchAxg',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request BindBatchAxgRequest
 * @return BindBatchAxgResponse
 */
async function bindBatchAxg(request: BindBatchAxgRequest): BindBatchAxgResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindBatchAxgWithOptions(request, runtime);
}

model BindXBRequest {
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  telB?: string(name='TelB', description='员工真实号码

This parameter is required.', example='18*******22'),
  telX?: string(name='TelX', description='X号码

This parameter is required.', example='17*******22'),
  userData?: string(name='UserData', description='客户自定义参数回调带回', example='000'),
}

model BindXBResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    authId?: string(name='AuthId', description='工作号关系绑定的唯一标识', example='4353453456'),
    telX?: string(name='TelX', description='X号码', example='18640577897'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='false'),
}

model BindXBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindXBResponseBody(name='body'),
}

/**
 * @summary 平台指定工作号X 和员工号B建立关联，完成X 实名认证，绑定生效后，所有X 的呼叫都会转接到B
 *
 * @param request BindXBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindXBResponse
 */
async function bindXBWithOptions(request: BindXBRequest, runtime: Util.RuntimeOptions): BindXBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.telB)) {
    query['TelB'] = request.telB;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  if (!Util.isUnset(request.userData)) {
    query['UserData'] = request.userData;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindXB',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 平台指定工作号X 和员工号B建立关联，完成X 实名认证，绑定生效后，所有X 的呼叫都会转接到B
 *
 * @param request BindXBRequest
 * @return BindXBResponse
 */
async function bindXB(request: BindXBRequest): BindXBResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindXBWithOptions(request, runtime);
}

model BuySecretNoRequest {
  city?: string(name='City', description='Specifies the home location of the phone number.

> 

*   The home location can be set only to a location in the Chinese mainland.

*   A phone number that starts with 95 does not have a home location. If you purchase a phone number that starts with 95, set this parameter to **Nationwide**.

This parameter is required.', example='hangzhou'),
  displayPool?: boolean(name='DisplayPool', description='Specifies whether to add the phone number to the pool of numbers that will be displayed during calls.

>  This parameter takes effect only for customers who have enabled the number display feature.', example='true'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The prefix of the phone number. If you specify the value of **SecretNo** when you purchase a phone number, a phone number starting with the specified prefix is selected.

>  You can specify up to 18 digits of the phone number prefix.', example='130'),
  specId?: long(name='SpecId', description='The type of the phone number. Valid values:

*   **1**: a phone number assigned by a virtual network operator, that is, a phone number that belongs to the 170 or 171 number segment.
*   **2**: a phone number provided by a carrier.
*   **3**: a phone number that starts with 95.

This parameter is required.', example='1'),
}

model BuySecretNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='2D1AEB96-96D0-454E-B0DC-AE2A8DF08020'),
  secretBuyInfoDTO?: {
    secretNo?: string(name='SecretNo', description='The private number, that is, phone number X.', example='1390000****'),
  }(name='SecretBuyInfoDTO', description='The information returned after the operation was called.'),
}

model BuySecretNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BuySecretNoResponseBody(name='body'),
}

/**
 * @summary Purchases a phone number.
 *
 * @description *   After you create a phone number pool in the Phone Number Protection console, the phone number pool is empty by default. You must purchase phone numbers and add them to the phone number pool.
 * *   Before you call this operation, make sure that you are familiar with the [pricing](https://help.aliyun.com/document_detail/59825.html) of Phone Number Protection.
 * *   When purchasing a phone number, specify the home location. If no sufficient phone numbers are available for purchase in the home location, the purchase of the phone number fails. Before you call this operation to purchase a phone number, check the quantity of phone numbers available for purchase by using the [QuerySecretNoRemain](https://help.aliyun.com/document_detail/111699.html) operation.
 * *   The account used to purchase a phone number must be an enterprise account that has passed real-name verification. For more information about how to perform real-name verification, see [Enterprise verification FAQs](https://help.aliyun.com/document_detail/37172.html).
 *
 * @param request BuySecretNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BuySecretNoResponse
 */
async function buySecretNoWithOptions(request: BuySecretNoRequest, runtime: Util.RuntimeOptions): BuySecretNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.displayPool)) {
    query['DisplayPool'] = request.displayPool;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  if (!Util.isUnset(request.specId)) {
    query['SpecId'] = request.specId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BuySecretNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Purchases a phone number.
 *
 * @description *   After you create a phone number pool in the Phone Number Protection console, the phone number pool is empty by default. You must purchase phone numbers and add them to the phone number pool.
 * *   Before you call this operation, make sure that you are familiar with the [pricing](https://help.aliyun.com/document_detail/59825.html) of Phone Number Protection.
 * *   When purchasing a phone number, specify the home location. If no sufficient phone numbers are available for purchase in the home location, the purchase of the phone number fails. Before you call this operation to purchase a phone number, check the quantity of phone numbers available for purchase by using the [QuerySecretNoRemain](https://help.aliyun.com/document_detail/111699.html) operation.
 * *   The account used to purchase a phone number must be an enterprise account that has passed real-name verification. For more information about how to perform real-name verification, see [Enterprise verification FAQs](https://help.aliyun.com/document_detail/37172.html).
 *
 * @param request BuySecretNoRequest
 * @return BuySecretNoResponse
 */
async function buySecretNo(request: BuySecretNoRequest): BuySecretNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return buySecretNoWithOptions(request, runtime);
}

model CancelPickUpWaybillRequest {
  cancelDesc?: string(name='CancelDesc', description='The cancellation reason.

This parameter is required.', example='{\\\\"action\\\\":\\\\"UPDATE_DESC\\\\",\\\\"value\\\\":\\\\"The courier is unable to pick up the package.\\\\"}'),
  outerOrderCode?: string(name='OuterOrderCode', description='The ID of the external order.

This parameter is required.', example='1145678823****'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CancelPickUpWaybillResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  data?: {
    errorCode?: string(name='ErrorCode', description='The error code.', example='none'),
    errorMsg?: string(name='ErrorMsg', description='The error message.', example='none'),
    message?: string(name='Message', description='The cancellation result.', example='OK'),
    success?: boolean(name='Success', description='Indicates whether the cancellation was successful.', example='true'),
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='9FC30594-3841-43AD-9008-03393BCB5CD2'),
}

model CancelPickUpWaybillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelPickUpWaybillResponseBody(name='body'),
}

/**
 * @summary Cancels a door-to-door delivery order.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CancelPickUpWaybillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelPickUpWaybillResponse
 */
async function cancelPickUpWaybillWithOptions(request: CancelPickUpWaybillRequest, runtime: Util.RuntimeOptions): CancelPickUpWaybillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cancelDesc)) {
    query['CancelDesc'] = request.cancelDesc;
  }
  if (!Util.isUnset(request.outerOrderCode)) {
    query['OuterOrderCode'] = request.outerOrderCode;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelPickUpWaybill',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels a door-to-door delivery order.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CancelPickUpWaybillRequest
 * @return CancelPickUpWaybillResponse
 */
async function cancelPickUpWaybill(request: CancelPickUpWaybillRequest): CancelPickUpWaybillResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelPickUpWaybillWithOptions(request, runtime);
}

model ConfigXRequest {
  callAbility?: string(name='CallAbility', description='开/关呼叫能力状态‘0’：禁用‘1’：开启', example='0'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='1898871967585852'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  GNFlag?: string(name='GNFlag', description='是否透传来显为真实主叫：00-非透传：互相拨打时都显示工作号;10-透传：A客户为主叫时,B员工的来显为客户A号码;B员工为主叫时,A客户的来显为工作号;默认为 00', example='0'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sequenceCalls?: [ 
    {
      sequenceCallNoPlayCode?: string(name='SequenceCallNoPlayCode', description='顺振提示音放音编号，格式如callNoPlayCode', example='01'),
      sequenceCalledNo?: string(name='SequenceCalledNo', description='顺振被叫号码', example='18*******33'),
      sequenceCalledPlayCode?: string(name='SequenceCalledPlayCode', description='接通后主被叫放音编号，格式如calledPlayCode', example='02'),
    }
  ](name='SequenceCalls', description='顺振控制参数'),
  sequenceMode?: string(name='SequenceMode', description='顺振模式：0-不顺振（默认）1-有条件顺振，先接续calledNo指定被叫，如果该被叫未能接通，再顺振sequenceCalls号码列表2-无条件顺振，不接续calledNo指定被叫，直接顺振sequenceCalls号码列表', example='0'),
  smsAbility?: string(name='SmsAbility', description='开/关短信功能状态‘0’：禁用；‘1’：开启；', example='0'),
  smsSignMode?: string(name='SmsSignMode', description='是否透传来显为真实用户0：不透传; 1：透传默认：0不透传', example='0'),
  telX?: string(name='TelX', description='X号码

This parameter is required.', example='17*******22'),
}

model ConfigXShrinkRequest {
  callAbility?: string(name='CallAbility', description='开/关呼叫能力状态‘0’：禁用‘1’：开启', example='0'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='1898871967585852'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  GNFlag?: string(name='GNFlag', description='是否透传来显为真实主叫：00-非透传：互相拨打时都显示工作号;10-透传：A客户为主叫时,B员工的来显为客户A号码;B员工为主叫时,A客户的来显为工作号;默认为 00', example='0'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sequenceCallsShrink?: string(name='SequenceCalls', description='顺振控制参数'),
  sequenceMode?: string(name='SequenceMode', description='顺振模式：0-不顺振（默认）1-有条件顺振，先接续calledNo指定被叫，如果该被叫未能接通，再顺振sequenceCalls号码列表2-无条件顺振，不接续calledNo指定被叫，直接顺振sequenceCalls号码列表', example='0'),
  smsAbility?: string(name='SmsAbility', description='开/关短信功能状态‘0’：禁用；‘1’：开启；', example='0'),
  smsSignMode?: string(name='SmsSignMode', description='是否透传来显为真实用户0：不透传; 1：透传默认：0不透传', example='0'),
  telX?: string(name='TelX', description='X号码

This parameter is required.', example='17*******22'),
}

model ConfigXResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', example='0000'),
  data?: {
    code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
    message?: string(name='Message', description='返回信息', example='成功'),
    success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', example='true'),
}

model ConfigXResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfigXResponseBody(name='body'),
}

/**
 * @summary 配置X号码，单独对工作号的话音呼叫、企业名片等通信功能进行配置操作
 *
 * @param tmpReq ConfigXRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfigXResponse
 */
async function configXWithOptions(tmpReq: ConfigXRequest, runtime: Util.RuntimeOptions): ConfigXResponse {
  Util.validateModel(tmpReq);
  var request = new ConfigXShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.sequenceCalls)) {
    request.sequenceCallsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sequenceCalls, 'SequenceCalls', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.callAbility)) {
    query['CallAbility'] = request.callAbility;
  }
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.GNFlag)) {
    query['GNFlag'] = request.GNFlag;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sequenceCallsShrink)) {
    query['SequenceCalls'] = request.sequenceCallsShrink;
  }
  if (!Util.isUnset(request.sequenceMode)) {
    query['SequenceMode'] = request.sequenceMode;
  }
  if (!Util.isUnset(request.smsAbility)) {
    query['SmsAbility'] = request.smsAbility;
  }
  if (!Util.isUnset(request.smsSignMode)) {
    query['SmsSignMode'] = request.smsSignMode;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfigX',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 配置X号码，单独对工作号的话音呼叫、企业名片等通信功能进行配置操作
 *
 * @param request ConfigXRequest
 * @return ConfigXResponse
 */
async function configX(request: ConfigXRequest): ConfigXResponse {
  var runtime = new Util.RuntimeOptions{};
  return configXWithOptions(request, runtime);
}

model CreateAxgGroupRequest {
  name?: string(name='Name', description='The name of number group G. If the name of number group G is not specified, the ID of number group G is used as the name of number group G.

>  The value must be 1 to 128 characters in length.', example='Aliyun'),
  numbers?: string(name='Numbers', description='The phone numbers that you add to number group G. Separate multiple phone numbers with commas (,). A maximum of 200 phone numbers can be added to number group G.', example='1390000****,1380000****'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC123456'),
  remark?: string(name='Remark', description='The remarks of number group G. The value must be 0 to 256 characters in length.', example='test'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateAxgGroupResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  groupId?: long(name='GroupId', description='The ID of number group G. The value of this parameter is required when the [BindAxg](https://help.aliyun.com/document_detail/110249.html) operation is called to add an AXG binding.', example='2000000000001'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='635C0FDA-9EBC-43D7-B368-9F583C08A126'),
}

model CreateAxgGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAxgGroupResponseBody(name='body'),
}

/**
 * @summary Creates number group G.
 *
 * @description Before you add an AXG binding, you must purchase phone number X, create number group G, and then add phone numbers to number group G. If you do not add phone numbers to number group G after you create number group G, you can call the [OperateAxgGroup](https://help.aliyun.com/document_detail/110252.htm) operation to add phone numbers to number group G.
 * >  Up to 2,000 number groups G can be added for a single phone number pool.
 *
 * @param request CreateAxgGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAxgGroupResponse
 */
async function createAxgGroupWithOptions(request: CreateAxgGroupRequest, runtime: Util.RuntimeOptions): CreateAxgGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.numbers)) {
    query['Numbers'] = request.numbers;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAxgGroup',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates number group G.
 *
 * @description Before you add an AXG binding, you must purchase phone number X, create number group G, and then add phone numbers to number group G. If you do not add phone numbers to number group G after you create number group G, you can call the [OperateAxgGroup](https://help.aliyun.com/document_detail/110252.htm) operation to add phone numbers to number group G.
 * >  Up to 2,000 number groups G can be added for a single phone number pool.
 *
 * @param request CreateAxgGroupRequest
 * @return CreateAxgGroupResponse
 */
async function createAxgGroup(request: CreateAxgGroupRequest): CreateAxgGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAxgGroupWithOptions(request, runtime);
}

model CreateFixedNoAReportRequest {
  ANoWhiteGroupId?: long(name='ANoWhiteGroupId', description='所属a号码组id

This parameter is required.', example='12'),
  custName?: string(name='CustName', description='姓名

This parameter is required.', example='赵**'),
  custPhoneNo?: string(name='CustPhoneNo', description='经办人/法人电话', example='130*****8888'),
  custType?: long(name='CustType', description='固话客户类型 1:法人,2:经办人

This parameter is required.', example='1'),
  documentNumber?: string(name='DocumentNumber', description='证件号码

This parameter is required.', example='370*********'),
  documentType?: long(name='DocumentType', description='证件类型 填写1表示身份证

This parameter is required.', example='1'),
  fixedLineWorkId?: string(name='FixedLineWorkId', description='固话申请时服务大厅工单号', example='45***12'),
  fixedNoA?: string(name='FixedNoA', description='a号码(固话)

This parameter is required.', example='89*****1234'),
  idCardAlivePhoto?: string(name='IdCardAlivePhoto', description='正面人像照片 OSS 路径地址

This parameter is required.', example='123456/test1719383196033.jpg'),
  idCardBackPhoto?: string(name='IdCardBackPhoto', description='身份证反面照片oss路径地址', example='123456/test1719383196032.jpg'),
  idCardFrontPhoto?: string(name='IdCardFrontPhoto', description='身份证正面照片oss路径地址', example='123456/test1719383196031.jpg'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='备注（客户自己的业务备注，可编辑）', example='***报备'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateFixedNoAReportResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='请求状态码', example='200'),
  data?: {
    createResult?: boolean(name='CreateResult', description='创建结果', example='true'),
    failType?: long(name='FailType', description='创建类型枚举，1为成功，负数为创建失败', example='1'),
  }(name='Data', description='A号码报备结果结构体'),
  message?: string(name='Message', description='失败错误提示', example='示例值示例值'),
  requestId?: string(name='RequestId', description='返回id', example='1D73E648-0978-18A5-B089-3BB2'),
  success?: boolean(name='Success', description='请求是否成功', example='true'),
}

model CreateFixedNoAReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFixedNoAReportResponseBody(name='body'),
}

/**
 * @summary 通过API收集小号a号码固话
 *
 * @param request CreateFixedNoAReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFixedNoAReportResponse
 */
async function createFixedNoAReportWithOptions(request: CreateFixedNoAReportRequest, runtime: Util.RuntimeOptions): CreateFixedNoAReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ANoWhiteGroupId)) {
    query['ANoWhiteGroupId'] = request.ANoWhiteGroupId;
  }
  if (!Util.isUnset(request.custName)) {
    query['CustName'] = request.custName;
  }
  if (!Util.isUnset(request.custPhoneNo)) {
    query['CustPhoneNo'] = request.custPhoneNo;
  }
  if (!Util.isUnset(request.custType)) {
    query['CustType'] = request.custType;
  }
  if (!Util.isUnset(request.documentNumber)) {
    query['DocumentNumber'] = request.documentNumber;
  }
  if (!Util.isUnset(request.documentType)) {
    query['DocumentType'] = request.documentType;
  }
  if (!Util.isUnset(request.fixedLineWorkId)) {
    query['FixedLineWorkId'] = request.fixedLineWorkId;
  }
  if (!Util.isUnset(request.fixedNoA)) {
    query['FixedNoA'] = request.fixedNoA;
  }
  if (!Util.isUnset(request.idCardAlivePhoto)) {
    query['IdCardAlivePhoto'] = request.idCardAlivePhoto;
  }
  if (!Util.isUnset(request.idCardBackPhoto)) {
    query['IdCardBackPhoto'] = request.idCardBackPhoto;
  }
  if (!Util.isUnset(request.idCardFrontPhoto)) {
    query['IdCardFrontPhoto'] = request.idCardFrontPhoto;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFixedNoAReport',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通过API收集小号a号码固话
 *
 * @param request CreateFixedNoAReportRequest
 * @return CreateFixedNoAReportResponse
 */
async function createFixedNoAReport(request: CreateFixedNoAReportRequest): CreateFixedNoAReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFixedNoAReportWithOptions(request, runtime);
}

model CreatePhoneNoAReportRequest {
  ANoWhiteGroupId?: long(name='ANoWhiteGroupId', description='所属a号码组id

This parameter is required.', example='19'),
  custName?: string(name='CustName', description='姓名

This parameter is required.', example='赵**'),
  documentNumber?: string(name='DocumentNumber', description='证件号码

This parameter is required.', example='370*********'),
  documentType?: long(name='DocumentType', description='证件类型 填写1表示身份证

This parameter is required.', example='1'),
  idCardAlivePhoto?: string(name='IdCardAlivePhoto', description='半身照oss路径地址

This parameter is required.', example='123456/test1719383196033.jpg示例值'),
  idCardBackPhoto?: string(name='IdCardBackPhoto', description='身份证反面照片oss路径地址', example='123456/test1719383196032.jpg'),
  idCardFrontPhoto?: string(name='IdCardFrontPhoto', description='身份证正面照片oss路径地址', example='123456/test1719383196031.jpg'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='手机号

This parameter is required.', example='130*****1234'),
  remark?: string(name='Remark', description='备注（客户自己的业务备注，可编辑）', example='***报备'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreatePhoneNoAReportResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='请求状态码', example='200'),
  data?: {
    createResult?: boolean(name='CreateResult', description='创建结果', example='true'),
    failType?: long(name='FailType', description='创建类型枚举，1为成功，负数为创建失败', example='1'),
  }(name='Data', description='A号码报备结果结构体'),
  message?: string(name='Message', description='失败错误提示', example='手机号码***已存在'),
  requestId?: string(name='RequestId', description='返回id', example='1D73E648-0978-18A5-B089-3BB2'),
  success?: boolean(name='Success', description='请求是否成功', example='true'),
}

model CreatePhoneNoAReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePhoneNoAReportResponseBody(name='body'),
}

/**
 * @summary 通过API收集小号a号码手机号
 *
 * @param request CreatePhoneNoAReportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePhoneNoAReportResponse
 */
async function createPhoneNoAReportWithOptions(request: CreatePhoneNoAReportRequest, runtime: Util.RuntimeOptions): CreatePhoneNoAReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ANoWhiteGroupId)) {
    query['ANoWhiteGroupId'] = request.ANoWhiteGroupId;
  }
  if (!Util.isUnset(request.custName)) {
    query['CustName'] = request.custName;
  }
  if (!Util.isUnset(request.documentNumber)) {
    query['DocumentNumber'] = request.documentNumber;
  }
  if (!Util.isUnset(request.documentType)) {
    query['DocumentType'] = request.documentType;
  }
  if (!Util.isUnset(request.idCardAlivePhoto)) {
    query['IdCardAlivePhoto'] = request.idCardAlivePhoto;
  }
  if (!Util.isUnset(request.idCardBackPhoto)) {
    query['IdCardBackPhoto'] = request.idCardBackPhoto;
  }
  if (!Util.isUnset(request.idCardFrontPhoto)) {
    query['IdCardFrontPhoto'] = request.idCardFrontPhoto;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePhoneNoAReport',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通过API收集小号a号码手机号
 *
 * @param request CreatePhoneNoAReportRequest
 * @return CreatePhoneNoAReportResponse
 */
async function createPhoneNoAReport(request: CreatePhoneNoAReportRequest): CreatePhoneNoAReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPhoneNoAReportWithOptions(request, runtime);
}

model CreatePickUpWaybillRequest {
  appointGotEndTime?: string(name='AppointGotEndTime', description='The end time of the door-to-door pickup in the appointment. The value of **AppointGotEndTime** is the value of **EndTime** of **AppointTimes** in **CpTimeSelectList** returned by the [CreatePickUpWaybillPreQuery](~~CreatePickUpWaybillPreQuery~~#resultMapping) operation.

>  This parameter is required when **BizType** is set to **1**.', example='2021-01-01 12:00:00'),
  appointGotStartTime?: string(name='AppointGotStartTime', description='The start time of the door-to-door pickup in the appointment. The value of **AppointGotStartTime** is the value of **StartTime** of **AppointTimes** in **CpTimeSelectList** returned by the [CreatePickUpWaybillPreQuery](~~CreatePickUpWaybillPreQuery~~#resultMapping) operation.

>  This parameter is required when **BizType** is set to **1**.', example='2021-01-01 10:00:00'),
  bizType?: int32(name='BizType', description='The pickup mode. Valid values:

*   **0** (default): real-time order.
*   **1**: appointment order.', example='0'),
  consigneeAddress?: {
    addressDetail?: string(name='AddressDetail', description='The detailed address of the consignee.

This parameter is required.', example='XX community'),
    areaName?: string(name='AreaName', description='The district where the consignee is located.

This parameter is required.', example='xihu'),
    cityName?: string(name='CityName', description='The city where the consignee is located.

This parameter is required.', example='hangzhou'),
    provinceName?: string(name='ProvinceName', description='The province where the consignee is located.

This parameter is required.', example='zhejiang'),
    townName?: string(name='TownName', description='The street where the consignee is located.', example='XX Street'),
  }(name='ConsigneeAddress', description='The address of the consignee.

This parameter is required.'),
  consigneeMobile?: string(name='ConsigneeMobile', description='The mobile phone number of the consignee.

>  Either ConsigneeMobile or ConsigneePhone must be set.', example='1580000****'),
  consigneeName?: string(name='ConsigneeName', description='The name of the consignee.

This parameter is required.', example='Li'),
  consigneePhone?: string(name='ConsigneePhone', description='The landline phone number of the consignee.

>  Either ConsigneeMobile or ConsigneePhone must be set.', example='0570000****'),
  cpCode?: string(name='CpCode', description='The code of the courier company.', example='YTO'),
  goodsInfos?: [ 
    {
      name?: string(name='Name', description='The item name.', example='zhang'),
      quantity?: string(name='Quantity', description='The item quantity.', example='1'),
      weight?: string(name='Weight', description='The item weight. Unit: gram.', example='1000'),
    }
  ](name='GoodsInfos', description='The items.'),
  orderChannels?: string(name='OrderChannels', description='The external channel sources.

This parameter is required.', example='YUN_DIAN_SHANG'),
  outerOrderCode?: string(name='OuterOrderCode', description='The ID of the external order.

This parameter is required.', example='143234234266****'),
  remark?: string(name='Remark', description='The additional information about the order. The additional information will be printed on the order.', example='fragile'),
  sendAddress?: {
    addressDetail?: string(name='AddressDetail', description='The detailed address of the sender.

This parameter is required.', example='XX community'),
    areaName?: string(name='AreaName', description='The district where the sender is located.

This parameter is required.', example='wenjiang'),
    cityName?: string(name='CityName', description='The city where the sender is located.

This parameter is required.', example='chengdu'),
    provinceName?: string(name='ProvinceName', description='The province where the sender is located.

This parameter is required.', example='Sichuan'),
    townName?: string(name='TownName', description='The street where the sender is located.', example='XX Street'),
  }(name='SendAddress', description='The address of the sender.

This parameter is required.'),
  sendMobile?: string(name='SendMobile', description='The mobile phone number of the sender.

>  Either SendMobile or SendPhone must be set.', example='1596714****'),
  sendName?: string(name='SendName', description='The name of the sender.

This parameter is required.', example='Wang'),
  sendPhone?: string(name='SendPhone', description='The landline phone number of the sender.

>  Either SendMobile or SendPhone must be set.', example='05718845****'),
}

model CreatePickUpWaybillShrinkRequest {
  appointGotEndTime?: string(name='AppointGotEndTime', description='The end time of the door-to-door pickup in the appointment. The value of **AppointGotEndTime** is the value of **EndTime** of **AppointTimes** in **CpTimeSelectList** returned by the [CreatePickUpWaybillPreQuery](~~CreatePickUpWaybillPreQuery~~#resultMapping) operation.

>  This parameter is required when **BizType** is set to **1**.', example='2021-01-01 12:00:00'),
  appointGotStartTime?: string(name='AppointGotStartTime', description='The start time of the door-to-door pickup in the appointment. The value of **AppointGotStartTime** is the value of **StartTime** of **AppointTimes** in **CpTimeSelectList** returned by the [CreatePickUpWaybillPreQuery](~~CreatePickUpWaybillPreQuery~~#resultMapping) operation.

>  This parameter is required when **BizType** is set to **1**.', example='2021-01-01 10:00:00'),
  bizType?: int32(name='BizType', description='The pickup mode. Valid values:

*   **0** (default): real-time order.
*   **1**: appointment order.', example='0'),
  consigneeAddressShrink?: string(name='ConsigneeAddress', description='The address of the consignee.

This parameter is required.'),
  consigneeMobile?: string(name='ConsigneeMobile', description='The mobile phone number of the consignee.

>  Either ConsigneeMobile or ConsigneePhone must be set.', example='1580000****'),
  consigneeName?: string(name='ConsigneeName', description='The name of the consignee.

This parameter is required.', example='Li'),
  consigneePhone?: string(name='ConsigneePhone', description='The landline phone number of the consignee.

>  Either ConsigneeMobile or ConsigneePhone must be set.', example='0570000****'),
  cpCode?: string(name='CpCode', description='The code of the courier company.', example='YTO'),
  goodsInfosShrink?: string(name='GoodsInfos', description='The items.'),
  orderChannels?: string(name='OrderChannels', description='The external channel sources.

This parameter is required.', example='YUN_DIAN_SHANG'),
  outerOrderCode?: string(name='OuterOrderCode', description='The ID of the external order.

This parameter is required.', example='143234234266****'),
  remark?: string(name='Remark', description='The additional information about the order. The additional information will be printed on the order.', example='fragile'),
  sendAddressShrink?: string(name='SendAddress', description='The address of the sender.

This parameter is required.'),
  sendMobile?: string(name='SendMobile', description='The mobile phone number of the sender.

>  Either SendMobile or SendPhone must be set.', example='1596714****'),
  sendName?: string(name='SendName', description='The name of the sender.

This parameter is required.', example='Wang'),
  sendPhone?: string(name='SendPhone', description='The landline phone number of the sender.

>  Either SendMobile or SendPhone must be set.', example='05718845****'),
}

model CreatePickUpWaybillResponseBody = {
  data?: {
    cpCode?: string(name='CpCode', description='The code of the courier company.', example='YTO'),
    errorCode?: string(name='ErrorCode', description='The error code.', example='200'),
    errorMsg?: string(name='ErrorMsg', description='The error message.', example='none'),
    gotCode?: string(name='GotCode', description='The pickup code.', example='3524'),
    mailNo?: string(name='MailNo', description='The order ID.', example='77312345629****'),
    success?: string(name='Success', description='Indicates whether the request was successful.', example='true'),
  }(name='Data', description='The returned data.'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='9FC30594-3841-43AD-9008-03393BCB5CD2'),
}

model CreatePickUpWaybillResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePickUpWaybillResponseBody(name='body'),
}

/**
 * @summary Creates a door-to-door delivery order.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param tmpReq CreatePickUpWaybillRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePickUpWaybillResponse
 */
async function createPickUpWaybillWithOptions(tmpReq: CreatePickUpWaybillRequest, runtime: Util.RuntimeOptions): CreatePickUpWaybillResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePickUpWaybillShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.consigneeAddress)) {
    request.consigneeAddressShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.consigneeAddress, 'ConsigneeAddress', 'json');
  }
  if (!Util.isUnset(tmpReq.goodsInfos)) {
    request.goodsInfosShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.goodsInfos, 'GoodsInfos', 'json');
  }
  if (!Util.isUnset(tmpReq.sendAddress)) {
    request.sendAddressShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sendAddress, 'SendAddress', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appointGotEndTime)) {
    query['AppointGotEndTime'] = request.appointGotEndTime;
  }
  if (!Util.isUnset(request.appointGotStartTime)) {
    query['AppointGotStartTime'] = request.appointGotStartTime;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.consigneeAddressShrink)) {
    query['ConsigneeAddress'] = request.consigneeAddressShrink;
  }
  if (!Util.isUnset(request.consigneeMobile)) {
    query['ConsigneeMobile'] = request.consigneeMobile;
  }
  if (!Util.isUnset(request.consigneeName)) {
    query['ConsigneeName'] = request.consigneeName;
  }
  if (!Util.isUnset(request.consigneePhone)) {
    query['ConsigneePhone'] = request.consigneePhone;
  }
  if (!Util.isUnset(request.cpCode)) {
    query['CpCode'] = request.cpCode;
  }
  if (!Util.isUnset(request.goodsInfosShrink)) {
    query['GoodsInfos'] = request.goodsInfosShrink;
  }
  if (!Util.isUnset(request.orderChannels)) {
    query['OrderChannels'] = request.orderChannels;
  }
  if (!Util.isUnset(request.outerOrderCode)) {
    query['OuterOrderCode'] = request.outerOrderCode;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.sendAddressShrink)) {
    query['SendAddress'] = request.sendAddressShrink;
  }
  if (!Util.isUnset(request.sendMobile)) {
    query['SendMobile'] = request.sendMobile;
  }
  if (!Util.isUnset(request.sendName)) {
    query['SendName'] = request.sendName;
  }
  if (!Util.isUnset(request.sendPhone)) {
    query['SendPhone'] = request.sendPhone;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePickUpWaybill',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a door-to-door delivery order.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CreatePickUpWaybillRequest
 * @return CreatePickUpWaybillResponse
 */
async function createPickUpWaybill(request: CreatePickUpWaybillRequest): CreatePickUpWaybillResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPickUpWaybillWithOptions(request, runtime);
}

model CreatePickUpWaybillPreQueryRequest {
  consigneeInfo?: {
    addressInfo?: {
      addressDetail?: string(name='AddressDetail', description='The detailed address of the consignee.', example='XX community'),
      areaName?: string(name='AreaName', description='The district where the consignee is located.', example='chang,an'),
      cityName?: string(name='CityName', description='The city where the consignee is located.', example='Xi,an'),
      provinceName?: string(name='ProvinceName', description='The province where the consignee is located.', example='Shanxi'),
      townName?: string(name='TownName', description='The street where the consignee is located.', example='XX Street'),
    }(name='AddressInfo', description='The address of the consignee.'),
    mobile?: string(name='Mobile', description='The mobile phone number of the consignee.

This parameter is required.', example='1390000****'),
    name?: string(name='Name', description='The name of the consignee.

This parameter is required.', example='Li'),
  }(name='ConsigneeInfo', description='The consignee information.

This parameter is required.'),
  cpCode?: string(name='CpCode', description='The code of the courier company. If no courier company is specified, the system allocates a courier company.', example='YTO'),
  orderChannels?: string(name='OrderChannels', description='The identifier of the external channel source. It cannot contain underscores.

This parameter is required.', example='Test'),
  outerOrderCode?: string(name='OuterOrderCode', description='The order number of the access system.', example='787DFHHDS989****'),
  preWeight?: string(name='PreWeight', description='The estimated weight. Unit: gram.

>  If you need to query the estimated price, this parameter is required.', example='2000'),
  senderInfo?: {
    addressInfo?: {
      addressDetail?: string(name='AddressDetail', description='The detailed address of the sender.', example='XX community'),
      areaName?: string(name='AreaName', description='The district where the sender is located.', example='xihu'),
      cityName?: string(name='CityName', description='The city where the sender is located.', example='hangzhou'),
      provinceName?: string(name='ProvinceName', description='The province where the sender is located.', example='zhejiang'),
      townName?: string(name='TownName', description='The street where the sender is located.', example='XX Street'),
    }(name='AddressInfo', description='The address of the sender.'),
    mobile?: string(name='Mobile', description='The mobile phone number of the sender.

This parameter is required.', example='1390000****'),
    name?: string(name='Name', description='The name of the sender.

This parameter is required.', example='Wang'),
  }(name='SenderInfo', description='The sender information.

This parameter is required.'),
}

model CreatePickUpWaybillPreQueryShrinkRequest {
  consigneeInfoShrink?: string(name='ConsigneeInfo', description='The consignee information.

This parameter is required.'),
  cpCode?: string(name='CpCode', description='The code of the courier company. If no courier company is specified, the system allocates a courier company.', example='YTO'),
  orderChannels?: string(name='OrderChannels', description='The identifier of the external channel source. It cannot contain underscores.

This parameter is required.', example='Test'),
  outerOrderCode?: string(name='OuterOrderCode', description='The order number of the access system.', example='787DFHHDS989****'),
  preWeight?: string(name='PreWeight', description='The estimated weight. Unit: gram.

>  If you need to query the estimated price, this parameter is required.', example='2000'),
  senderInfoShrink?: string(name='SenderInfo', description='The sender information.

This parameter is required.'),
}

model CreatePickUpWaybillPreQueryResponseBody = {
  data?: {
    code?: string(name='Code', description='The response code.', example='0'),
    cpTimeSelectList?: [ 
      {
        appointTimes?: [ 
          {
            date?: string(name='Date', description='The date in the YYYY-MM-DD format.', example='2022-04-28'),
            dateSelectable?: boolean(name='DateSelectable', description='Indicates whether the date is selectable.', example='true'),
            timeList?: [ 
              {
                endTime?: string(name='EndTime', description='The end of the time range.', example='12:00:00'),
                selectDisableTip?: string(name='SelectDisableTip', description='The tip displayed when the scheduled pickup is not available.', example='Appointment Full'),
                selectable?: boolean(name='Selectable', description='Indicates whether the time range can be selected for the scheduled pickup.', example='true'),
                startTime?: string(name='StartTime', description='The beginning of the time range.', example='10:00:00'),
              }
            ](name='TimeList', description='The time range for the scheduled pickup for this date.'),
          }
        ](name='AppointTimes', description='The available time for the scheduled pickup. If the current courier company cannot accept the scheduled pickup, this field is left empty.'),
        prePrice?: string(name='PrePrice', description='The estimated price. Unit: CNY. The value is accurate to two decimal places. The value of this parameter is displayed if an estimated weight is specified.', example='12.50'),
        realTime?: {
          name?: string(name='Name', description='The name of the real-time order type.', example='Aliyun'),
          selectDisableTip?: string(name='SelectDisableTip', description='The tip displayed when the real-time order cannot be placed.', example='Exceeding the real-time ordering time range.'),
          selectable?: boolean(name='Selectable', description='Indicates whether the real-time order can be placed after the deadline for placing a real-time order is reached.', example='false'),
        }(name='RealTime', description='The information about whether the real-time order can be selected.'),
      }
    ](name='CpTimeSelectList', description='The information about whether the courier company can accept the order.'),
    errorCode?: string(name='ErrorCode', description='The error code.', example='Success'),
    errorMsg?: string(name='ErrorMsg', description='The error message.', example='none'),
    message?: string(name='Message', description='The response content.', example='Success'),
    success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  }(name='Data', description='The result set.'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='9FC30594-3841-43AD-9008-03393BCB5CD2'),
}

model CreatePickUpWaybillPreQueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePickUpWaybillPreQueryResponseBody(name='body'),
}

/**
 * @summary Queries a pickup order.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param tmpReq CreatePickUpWaybillPreQueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePickUpWaybillPreQueryResponse
 */
async function createPickUpWaybillPreQueryWithOptions(tmpReq: CreatePickUpWaybillPreQueryRequest, runtime: Util.RuntimeOptions): CreatePickUpWaybillPreQueryResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePickUpWaybillPreQueryShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.consigneeInfo)) {
    request.consigneeInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.consigneeInfo, 'ConsigneeInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.senderInfo)) {
    request.senderInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.senderInfo, 'SenderInfo', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.consigneeInfoShrink)) {
    query['ConsigneeInfo'] = request.consigneeInfoShrink;
  }
  if (!Util.isUnset(request.cpCode)) {
    query['CpCode'] = request.cpCode;
  }
  if (!Util.isUnset(request.orderChannels)) {
    query['OrderChannels'] = request.orderChannels;
  }
  if (!Util.isUnset(request.outerOrderCode)) {
    query['OuterOrderCode'] = request.outerOrderCode;
  }
  if (!Util.isUnset(request.preWeight)) {
    query['PreWeight'] = request.preWeight;
  }
  if (!Util.isUnset(request.senderInfoShrink)) {
    query['SenderInfo'] = request.senderInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePickUpWaybillPreQuery',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a pickup order.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request CreatePickUpWaybillPreQueryRequest
 * @return CreatePickUpWaybillPreQueryResponse
 */
async function createPickUpWaybillPreQuery(request: CreatePickUpWaybillPreQueryRequest): CreatePickUpWaybillPreQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPickUpWaybillPreQueryWithOptions(request, runtime);
}

model CreateSmsSignRequest {
  calledNo?: string(name='CalledNo', description='收信人号码

This parameter is required.', example='178****3614'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  callingNo?: string(name='CallingNo', description='发信人号码

This parameter is required.', example='150****6539'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateSmsSignResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    calledNoSign?: string(name='CalledNoSign', description='短信接收者号码签名串(加到短信内容中供解析真实被叫号码)', example='sign23343466'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='false'),
}

model CreateSmsSignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSmsSignResponseBody(name='body'),
}

/**
 * @summary B向A 发短信，客户端获取“短信标签”，尾部添加“标签”。通过“标签”解析被叫A，发短信到A。
 *
 * @param request CreateSmsSignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSmsSignResponse
 */
async function createSmsSignWithOptions(request: CreateSmsSignRequest, runtime: Util.RuntimeOptions): CreateSmsSignResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.calledNo)) {
    query['CalledNo'] = request.calledNo;
  }
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.callingNo)) {
    query['CallingNo'] = request.callingNo;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSmsSign',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary B向A 发短信，客户端获取“短信标签”，尾部添加“标签”。通过“标签”解析被叫A，发短信到A。
 *
 * @param request CreateSmsSignRequest
 * @return CreateSmsSignResponse
 */
async function createSmsSign(request: CreateSmsSignRequest): CreateSmsSignResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSmsSignWithOptions(request, runtime);
}

model DeleteAxbBindFixedLineRequest {
  appId?: string(name='AppId', description='应用id

This parameter is required.', example='ALPT_1234'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='A93IOELD93'),
  ts?: string(name='Ts', description='业务时间戳，格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20161114143116001'),
}

model DeleteAxbBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  code?: string(name='Code', example='isp.SYSTEM_ERROR'),
  data?: {
    code?: string(name='Code', description='响应码  0-成功', example='0'),
    message?: string(name='Message', description='响应消息', example='示例值示例值示例值'),
    success?: boolean(name='Success', description='是否处理成功  true-成功  false-失败', example='true'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='F036366A-0182-5066-A686-19C4C82F2D51'),
  success?: boolean(name='Success', example='True'),
}

model DeleteAxbBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAxbBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 固话AxB解绑
 *
 * @param request DeleteAxbBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAxbBindFixedLineResponse
 */
async function deleteAxbBindFixedLineWithOptions(request: DeleteAxbBindFixedLineRequest, runtime: Util.RuntimeOptions): DeleteAxbBindFixedLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAxbBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 固话AxB解绑
 *
 * @param request DeleteAxbBindFixedLineRequest
 * @return DeleteAxbBindFixedLineResponse
 */
async function deleteAxbBindFixedLine(request: DeleteAxbBindFixedLineRequest): DeleteAxbBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAxbBindFixedLineWithOptions(request, runtime);
}

model DeleteAxgGroupRequest {
  groupId?: long(name='GroupId', description='This parameter is required.', example='1234'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='This parameter is required.', example='FC2235****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteAxgGroupResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message', example='SUCCESS'),
  requestId?: string(name='RequestId', example='9297B722-A016-43FB-B51A-E54050D9369D'),
}

model DeleteAxgGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAxgGroupResponseBody(name='body'),
}

/**
 * @param request DeleteAxgGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAxgGroupResponse
 */
async function deleteAxgGroupWithOptions(request: DeleteAxgGroupRequest, runtime: Util.RuntimeOptions): DeleteAxgGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAxgGroup',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteAxgGroupRequest
 * @return DeleteAxgGroupResponse
 */
async function deleteAxgGroup(request: DeleteAxgGroupRequest): DeleteAxgGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAxgGroupWithOptions(request, runtime);
}

model DeleteAxnBindFixedLineRequest {
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='GHX0534X202504221531579290029-2-1-aliaxn'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model DeleteAxnBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', description='响应码 0：成功，其它失败，具体见文档', example='0'),
    message?: string(name='Message', description='描述信息', example='success'),
    success?: boolean(name='Success', example='true'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='AE2D6997-643A-59CB-9B3C-918572E5CEAA'),
  success?: boolean(name='Success', example='True'),
}

model DeleteAxnBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAxnBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 解绑已有Axn绑定
 *
 * @param request DeleteAxnBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAxnBindFixedLineResponse
 */
async function deleteAxnBindFixedLineWithOptions(request: DeleteAxnBindFixedLineRequest, runtime: Util.RuntimeOptions): DeleteAxnBindFixedLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAxnBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解绑已有Axn绑定
 *
 * @param request DeleteAxnBindFixedLineRequest
 * @return DeleteAxnBindFixedLineResponse
 */
async function deleteAxnBindFixedLine(request: DeleteAxnBindFixedLineRequest): DeleteAxnBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAxnBindFixedLineWithOptions(request, runtime);
}

model DeleteAxnExtensionBindFixedLineRequest {
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='GHX0534X202504221531579290029'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model DeleteAxnExtensionBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', description='响应码 0：成功，其它失败，具体见文档', example='0'),
    message?: string(name='Message', description='描述信息', example='success'),
    success?: boolean(name='Success', example='true'),
  }(name='Data'),
  message?: string(name='Message', example='conflict with subs id=1000203635098305, phoneA conflict'),
  requestId?: string(name='RequestId', example='3DA9D6DF-C5FA-5A0D-B6C2-547B1FD1F9B4'),
  success?: boolean(name='Success', example='True'),
}

model DeleteAxnExtensionBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAxnExtensionBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 解绑已有AXN分机号绑定
 *
 * @param request DeleteAxnExtensionBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAxnExtensionBindFixedLineResponse
 */
async function deleteAxnExtensionBindFixedLineWithOptions(request: DeleteAxnExtensionBindFixedLineRequest, runtime: Util.RuntimeOptions): DeleteAxnExtensionBindFixedLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAxnExtensionBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解绑已有AXN分机号绑定
 *
 * @param request DeleteAxnExtensionBindFixedLineRequest
 * @return DeleteAxnExtensionBindFixedLineResponse
 */
async function deleteAxnExtensionBindFixedLine(request: DeleteAxnExtensionBindFixedLineRequest): DeleteAxnExtensionBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAxnExtensionBindFixedLineWithOptions(request, runtime);
}

model DeleteSecretAPhoneNoToCustRequest {
  ANoWhiteGroupId?: long(name='ANoWhiteGroupId', description='A号码组ID

This parameter is required.', example='51'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='A号码

This parameter is required.', example='130*****1234'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteSecretAPhoneNoToCustResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='请求状态码', example='200'),
  data?: boolean(name='Data', description='删除是否成功', example='true'),
  message?: string(name='Message', description='失败错误提示', example='号码组不存在'),
  requestId?: string(name='RequestId', description='返回id', example='1D73E648-0978-18A5-B089-3BB2'),
  success?: boolean(name='Success', description='请求是否成功', example='true'),
}

model DeleteSecretAPhoneNoToCustResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecretAPhoneNoToCustResponseBody(name='body'),
}

/**
 * @summary A号码报备数据删除
 *
 * @param request DeleteSecretAPhoneNoToCustRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecretAPhoneNoToCustResponse
 */
async function deleteSecretAPhoneNoToCustWithOptions(request: DeleteSecretAPhoneNoToCustRequest, runtime: Util.RuntimeOptions): DeleteSecretAPhoneNoToCustResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ANoWhiteGroupId)) {
    query['ANoWhiteGroupId'] = request.ANoWhiteGroupId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSecretAPhoneNoToCust',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary A号码报备数据删除
 *
 * @param request DeleteSecretAPhoneNoToCustRequest
 * @return DeleteSecretAPhoneNoToCustResponse
 */
async function deleteSecretAPhoneNoToCust(request: DeleteSecretAPhoneNoToCustRequest): DeleteSecretAPhoneNoToCustResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSecretAPhoneNoToCustWithOptions(request, runtime);
}

model DeleteSecretBlacklistRequest {
  blackNo?: string(name='BlackNo', description='The phone numbers in the blacklist. A point-to-point blacklist has a pair of numbers separated by a colon (":"). A number pool blacklist or a platform blacklist has only one single number.

This parameter is required.', example='18252***383:18252***483'),
  blackType?: string(name='BlackType', description='The blacklist type. Valid values:

*   **POINT_TO_POINT_BLACK**: point-to-point blacklist
*   **PARTNER_GLOBAL_NUMBER_BLACK**: number pool blacklist

This parameter is required.', example='POINT_TO_POINT_BLACK'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC1232****'),
  remark?: string(name='Remark', description='The remarks for the blacklist.', example='fragile'),
  wayControl?: string(name='WayControl', description='The control on the call direction.

*   **PHONEA_REJECT**: The first phone number in the blacklist can be used to call the second phone number, but the second phone number in the blacklist cannot be used to call the first phone number.
*   **PHONEB_REJECT**: The first phone number in the blacklist cannot be used to call the second phone number, but the second phone number in the blacklist can be used to call the first phone number.
*   If this parameter is not specified, the two phone numbers in the blacklist cannot be used to call each other.

Valid values:

*   DUPLEX_REJECT
*   PHONEA_REJECT
*   PHONEB_REJECT', example='PHONEA_REJECT'),
}

model DeleteSecretBlacklistResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model DeleteSecretBlacklistResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecretBlacklistResponseBody(name='body'),
}

/**
 * @summary Deletes a blacklist.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeleteSecretBlacklistRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecretBlacklistResponse
 */
async function deleteSecretBlacklistWithOptions(request: DeleteSecretBlacklistRequest, runtime: Util.RuntimeOptions): DeleteSecretBlacklistResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackNo)) {
    query['BlackNo'] = request.blackNo;
  }
  if (!Util.isUnset(request.blackType)) {
    query['BlackType'] = request.blackType;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.wayControl)) {
    query['WayControl'] = request.wayControl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSecretBlacklist',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a blacklist.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DeleteSecretBlacklistRequest
 * @return DeleteSecretBlacklistResponse
 */
async function deleteSecretBlacklist(request: DeleteSecretBlacklistRequest): DeleteSecretBlacklistResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSecretBlacklistWithOptions(request, runtime);
}

model GetDyplsOSSInfoForUploadFileRequest {
  bizType?: string(name='BizType', description='This parameter is required.', example='phone_card'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetDyplsOSSInfoForUploadFileResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', example='OK'),
  data?: {
    accessKeyId?: string(name='AccessKeyId', example='LTAI***pSvPz'),
    expireTime?: string(name='ExpireTime', example='1744613007'),
    host?: string(name='Host', example='https://alicom-**********-cn-zhangjiakou.aliyuncs.com'),
    policy?: string(name='Policy', example='IjoiMjAyN*****9udGV'),
    signature?: string(name='Signature', example='BXwW**********aoZH'),
    startPath?: string(name='StartPath', example='123456'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='E2FD3B2F-5028-16E3-9F83-2F76F99B3873'),
  success?: boolean(name='Success', example='true'),
}

model GetDyplsOSSInfoForUploadFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDyplsOSSInfoForUploadFileResponseBody(name='body'),
}

/**
 * @summary 隐私号上传文件，获取 OSS 信息
 *
 * @param request GetDyplsOSSInfoForUploadFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDyplsOSSInfoForUploadFileResponse
 */
async function getDyplsOSSInfoForUploadFileWithOptions(request: GetDyplsOSSInfoForUploadFileRequest, runtime: Util.RuntimeOptions): GetDyplsOSSInfoForUploadFileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDyplsOSSInfoForUploadFile',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 隐私号上传文件，获取 OSS 信息
 *
 * @param request GetDyplsOSSInfoForUploadFileRequest
 * @return GetDyplsOSSInfoForUploadFileResponse
 */
async function getDyplsOSSInfoForUploadFile(request: GetDyplsOSSInfoForUploadFileRequest): GetDyplsOSSInfoForUploadFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDyplsOSSInfoForUploadFileWithOptions(request, runtime);
}

model GetSecretAsrDetailRequest {
  callId?: string(name='CallId', description='The ID of the call record.

You can log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view **Call Record ID** on the **Call Record Query** page.

This parameter is required.', example='225625****'),
  callTime?: string(name='CallTime', description='The call initiation time in the call record.

You can log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account). View **Call Initiated At** on the **Call Record Query** page, or view the call_time field in the Call Detail Record (CDR) receipt.

This parameter is required.', example='2019-03-05 12:00:00'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

You can log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC2267****'),
}

model GetSecretAsrDetailResponseBody = {
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: {
    bizDuration?: long(name='BizDuration', description='The total duration of the audio file that was recognized. Unit: milliseconds.', example='10944'),
    businessId?: string(name='BusinessId', description='The ID of the business process.', example='435ee78c7a019650@!FC100000074672458@!2020061522****'),
    businessKey?: string(name='BusinessKey', description='The business keyword.', example='JCGTncltuNao****'),
    code?: string(name='Code', description='The status code. The status code 21050000 indicates that the request was successful.', example='21050000'),
    msg?: string(name='Msg', description='The description.', example='SUCCESS'),
    requestId?: string(name='RequestId', description='The request ID.', example='8d2329d407a83447a83be441681f4872ac74nE'),
    sentences?: [ 
      {
        beginTime?: long(name='BeginTime', description='The start time offset of the sentence. Unit: milliseconds.', example='1020'),
        channelId?: int32(name='ChannelId', description='The ID of the audio track to which the sentence belongs.', example='0'),
        emotionValue?: string(name='EmotionValue', description='The emotion value. Value range: 1 to 10. The higher the value, the stronger the emotion.', example='5.7'),
        endTime?: long(name='EndTime', description='The end time offset of the sentence. Unit: milliseconds.', example='1770'),
        silenceDuration?: long(name='SilenceDuration', description='The silence duration between the current sentence and the previous sentence. Unit: seconds.', example='0'),
        speechRate?: int32(name='SpeechRate', description='The average speech rate of the sentence. Unit: number of words per minute.', example='80'),
        text?: string(name='Text', description='The recognition result of the sentence.', example='Hello'),
      }
    ](name='Sentences', description='The ASR result.'),
    type?: string(name='Type', description='The type.', example='asrResult'),
  }(name='Data', description='The ASR details.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'),
}

model GetSecretAsrDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSecretAsrDetailResponseBody(name='body'),
}

/**
 * @summary Obtains the details of the automatic speech recognition (ASR) result.
 *
 * @description Before you call the GetSecretAsrDetail operation, set the ASRStatus parameter to true in the [BindAxn operation](https://help.aliyun.com/document_detail/400483.html). This ensures that you can obtain the ASR result properly.
 * ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetSecretAsrDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSecretAsrDetailResponse
 */
async function getSecretAsrDetailWithOptions(request: GetSecretAsrDetailRequest, runtime: Util.RuntimeOptions): GetSecretAsrDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.callTime)) {
    query['CallTime'] = request.callTime;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSecretAsrDetail',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the details of the automatic speech recognition (ASR) result.
 *
 * @description Before you call the GetSecretAsrDetail operation, set the ASRStatus parameter to true in the [BindAxn operation](https://help.aliyun.com/document_detail/400483.html). This ensures that you can obtain the ASR result properly.
 * ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetSecretAsrDetailRequest
 * @return GetSecretAsrDetailResponse
 */
async function getSecretAsrDetail(request: GetSecretAsrDetailRequest): GetSecretAsrDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSecretAsrDetailWithOptions(request, runtime);
}

model GetTotalPublicUrlRequest {
  callId?: string(name='CallId', description='The ID of the call record.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view **Call Record ID** on the **Call Record Query** page.

This parameter is required.', example='2568900****'),
  callTime?: string(name='CallTime', description='The call initiation time in the call record.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account). View **Call Initiated At** on the **Call Record Query** page, or view the call_time field in the Call Detail Record (CDR) receipt.

This parameter is required.', example='2019-03-05 12:00:00'),
  checkSubs?: boolean(name='CheckSubs', description='Specifies whether the verification on the binding ID is required.

This parameter is required.', example='false'),
  ownerId?: long(name='OwnerId'),
  partnerKey?: string(name='PartnerKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC12256****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetTotalPublicUrlResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  data?: {
    phonePublicUrl?: string(name='PhonePublicUrl', description='The download URL of the recorded call.

>  The download URL of the recorded call is valid for 30 days.', example='http://secret-axb-reco****cn-shanghai.aliyuncs.com/1000000820257625_66647243838006067251551752068865.mp3?Expires=1551****07&OSSAccessKeyId=LTAIP00vvvv****v&Signature=tK6Yq9KusU4n%2BZQWX****4/WmEA%3D'),
    ringPublicUrl?: string(name='RingPublicUrl', description='The download URL of the recorded ringing tone.

>  The download URL of the recorded ringing tone is valid for 30 days.', example='http://secret-ab-reco****cn-shanghai.aliyuncs.com/1000000820257625_66647243838006067251551752068865.mp3?Expires=155175****&OSSAccessKeyId=LTAIP00vvv****vv&Signature=tK6Yq9KusU4n%2BZQW****g4/WmEA%3D'),
  }(name='Data', description='The download URLs of the recording files.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AB3CEF7-DCBE-488C-9C33-D180982CE031'),
}

model GetTotalPublicUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTotalPublicUrlResponseBody(name='body'),
}

/**
 * @summary Obtains the download URL of a recorded ringing tone.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetTotalPublicUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTotalPublicUrlResponse
 */
async function getTotalPublicUrlWithOptions(request: GetTotalPublicUrlRequest, runtime: Util.RuntimeOptions): GetTotalPublicUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.callTime)) {
    query['CallTime'] = request.callTime;
  }
  if (!Util.isUnset(request.checkSubs)) {
    query['CheckSubs'] = request.checkSubs;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.partnerKey)) {
    query['PartnerKey'] = request.partnerKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTotalPublicUrl',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the download URL of a recorded ringing tone.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request GetTotalPublicUrlRequest
 * @return GetTotalPublicUrlResponse
 */
async function getTotalPublicUrl(request: GetTotalPublicUrlRequest): GetTotalPublicUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTotalPublicUrlWithOptions(request, runtime);
}

model GetXConfigRequest {
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  telX?: string(name='TelX', description='X号码

This parameter is required.', example='17*******22'),
}

model GetXConfigResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    callAbility?: string(name='CallAbility', description='开/关呼叫能力状态： ‘0’：禁用； ‘1’：开启；', example='0'),
    GNFlag?: string(name='GNFlag', description='是否透传来显为真实主叫： 00-非透传：互相拨打时都显示工作号; 10-透传：A客户为主叫时,B员工的来显为客户A号码;B员工为主叫时,A客户的来显为工作号; 默认为 00', example='00'),
    reachJsons?: [ 
      {
        callDir?: string(name='CallDir', description='呼叫方向 1:员工B呼叫客户A 2:客户A呼叫员工B', example='1'),
        callStatus?: string(name='CallStatus', description='通话状态 1:通话振铃 2:接通前 3:接通后 4:通话结束 5:已接通6:未接通', example='1'),
        receiveDir?: string(name='ReceiveDir', description='接收方向 1:主叫 2:被叫', example='1'),
        ruleId?: string(name='RuleId', description='规则ID', example='345'),
        ruleName?: string(name='RuleName', description='规则名称', example='企业名片-短信规则'),
        ruleType?: string(name='RuleType', description='规则类型： 1：企业名片-短信 2：企业名片-闪信 3：企业名片-视频 4：企业名片-音频', example='1'),
        tempId?: string(name='TempId', description='模板ID', example='12345'),
      }
    ](name='ReachJsons', description='企业名片规则控制参数'),
    sequenceCalls?: [ 
      {
        sequenceCallNoPlayCode?: string(name='SequenceCallNoPlayCode', description='顺振提示音放音编号，格式如callNoPlayCode', example='示例值示例值示例值'),
        sequenceCalledNo?: string(name='SequenceCalledNo', description='顺振被叫号码', example='示例值示例值示例值'),
        sequenceCalledPlayCode?: string(name='SequenceCalledPlayCode', description='接通后主被叫放音编号，格式如calledPlayCode', example='示例值示例值示例值'),
      }
    ](name='SequenceCalls', description='顺振控制参数'),
    sequenceEndTime?: string(name='SequenceEndTime', description='顺振结束时间 格式：HH:mm:ss 18:00:00', example='09:00:00'),
    sequenceStartTime?: string(name='SequenceStartTime', description='顺振开启时间 格式：HH:mm:ss 09:00:00', example='09:00:00'),
    smsAbility?: string(name='SmsAbility', description='开/关短信功能状态： ‘0’：禁用； ‘1’：开启；', example='0'),
    smsSignMode?: string(name='SmsSignMode', description='是否透传来显为真实主叫： 00-非透传：互相拨打时都显示工作号; 10-透传：A客户为主叫时,B员工的来显为客户A号码;B员工为主叫时,A客户的来显为工作号; 默认为 00', example='0'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
}

model GetXConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetXConfigResponseBody(name='body'),
}

/**
 * @summary 获取X号码配置信息
 *
 * @param request GetXConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetXConfigResponse
 */
async function getXConfigWithOptions(request: GetXConfigRequest, runtime: Util.RuntimeOptions): GetXConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetXConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取X号码配置信息
 *
 * @param request GetXConfigRequest
 * @return GetXConfigResponse
 */
async function getXConfig(request: GetXConfigRequest): GetXConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getXConfigWithOptions(request, runtime);
}

model GetXDefaultConfigRequest {
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  telX?: string(name='TelX', description='X号码

This parameter is required.', example='17*******22'),
}

model GetXDefaultConfigResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    callAbility?: string(name='CallAbility', description='开/关呼叫能力状态： ‘0’：禁用； ‘1’：开启；', example='0'),
    GNFlag?: string(name='GNFlag', description='是否透传来显为真实主叫： 00-非透传：互相拨打时都显示工作号; 10-透传：A客户为主叫时,B员工的来显为客户A号码;B员工为主叫时,A客户的来显为工作号; 默认为 00', example='00'),
    reachJson?: [ 
      {
        callDir?: string(name='CallDir', description='呼叫方向 1:员工B呼叫客户A 2:客户A呼叫员工B', example='1'),
        callStatus?: string(name='CallStatus', description='通话状态 1:通话振铃 2:接通前 3:接通后 4:通话结束 5:已接通6:未接通', example='1'),
        receiveDir?: string(name='ReceiveDir', description='接收方向 1:主叫 2:被叫', example='1'),
        ruleId?: string(name='RuleId', description='规则ID', example='345'),
        ruleName?: string(name='RuleName', description='规则名称', example='企业名片-短信规则'),
        ruleType?: string(name='RuleType', description='规则类型： 1：企业名片-短信 2：企业名片-闪信 3：企业名片-视频 4：企业名片-音频', example='1'),
        tempId?: string(name='TempId', description='模板ID', example='12345'),
      }
    ](name='ReachJson', description='企业名片规则控制参数'),
    sequenceCall?: [ 
      {
        sequenceCallNoPlayCode?: string(name='SequenceCallNoPlayCode', description='顺振提示音放音编号，格式如callNoPlayCode', example='示例值'),
        sequenceCalledNo?: string(name='SequenceCalledNo', description='顺振被叫号码', example='示例值示例值示例值'),
        sequenceCalledPlayCode?: string(name='SequenceCalledPlayCode', description='接通后主被叫放音编号，格式如calledPlayCode', example='示例值示例值示例值'),
      }
    ](name='SequenceCall', description='顺振控制参数'),
    sequenceEndTime?: string(name='SequenceEndTime', description='顺振结束时间 格式：HH:mm:ss 18:00:00', example='09:00:00'),
    sequenceStartTime?: string(name='SequenceStartTime', description='顺振开启时间 格式：HH:mm:ss 09:00:00', example='09:00:00'),
    smsAbility?: string(name='SmsAbility', description='开/关短信功能状态： ‘0’：禁用； ‘1’：开启；', example='0'),
    smsSignMode?: string(name='SmsSignMode', description='是否透传来显为真实主叫： 00-非透传：互相拨打时都显示工作号; 10-透传：A客户为主叫时,B员工的来显为客户A号码;B员工为主叫时,A客户的来显为工作号; 默认为 00', example='0'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
}

model GetXDefaultConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetXDefaultConfigResponseBody(name='body'),
}

/**
 * @summary 获取X号码默认配置信息
 *
 * @param request GetXDefaultConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetXDefaultConfigResponse
 */
async function getXDefaultConfigWithOptions(request: GetXDefaultConfigRequest, runtime: Util.RuntimeOptions): GetXDefaultConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetXDefaultConfig',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取X号码默认配置信息
 *
 * @param request GetXDefaultConfigRequest
 * @return GetXDefaultConfigResponse
 */
async function getXDefaultConfig(request: GetXDefaultConfigRequest): GetXDefaultConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getXDefaultConfigWithOptions(request, runtime);
}

model ListXTelephonesRequest {
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='页码从1开始', example='1'),
  pageSize?: long(name='PageSize', description='每页条数', example='10'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListXTelephonesResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    list?: [ 
      {
        authMsg?: string(name='AuthMsg', description='绑定失败原因', example='绑定失败用户身份证黑名单'),
        bindTime?: string(name='BindTime', description='绑定时间', example='2024-08-29 17:23:58'),
        buyTime?: string(name='BuyTime', description='购买时间', example='2024-08-29 17:23:58'),
        customerPoolKey?: string(name='CustomerPoolKey', description='客户号码池key', example='FC533e6eeb81f4400c87ef3745a21a1a'),
        customerPoolName?: string(name='CustomerPoolName', description='号码池名称', example='测试号码池'),
        releaseTime?: string(name='ReleaseTime', description='释放时间', example='2024-08-29 17:23:58'),
        smsStatus?: string(name='SmsStatus', description='短信开通状态：0 未开通 1已开通', example='0'),
        telephone?: string(name='Telephone', description='X号码', example='17816876546'),
        telephoneStatus?: string(name='TelephoneStatus', description='号码状态：0 空闲中 1 调拨完成待购买 2购买完成待认证  3 实名认证中  4 实名认证成功  5 认证失败  6 解绑中 7 解绑失败 8已释放 99 超时释放', example='0'),
        unbindTime?: string(name='UnbindTime', description='解绑时间', example='2024-08-29 17:23:58'),
      }
    ](name='List', description='数据集合'),
    pageNo?: long(name='PageNo', description='页码', example='1'),
    pageSize?: long(name='PageSize', description='每页条数', example='10'),
    total?: long(name='Total', description='符合查询条件的总数量', example='50'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
}

model ListXTelephonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListXTelephonesResponseBody(name='body'),
}

/**
 * @summary 查询客户名下X号码列表
 *
 * @param request ListXTelephonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListXTelephonesResponse
 */
async function listXTelephonesWithOptions(request: ListXTelephonesRequest, runtime: Util.RuntimeOptions): ListXTelephonesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListXTelephones',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询客户名下X号码列表
 *
 * @param request ListXTelephonesRequest
 * @return ListXTelephonesResponse
 */
async function listXTelephones(request: ListXTelephonesRequest): ListXTelephonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listXTelephonesWithOptions(request, runtime);
}

model LockSecretNoRequest {
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC123****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The private number that you want to lock. You must enter a complete mobile phone number.

This parameter is required.', example='1300000****'),
}

model LockSecretNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='2D1AEB96-96D0-454E-B0DC-AE2A8DF08020'),
}

model LockSecretNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LockSecretNoResponseBody(name='body'),
}

/**
 * @summary Locks a phone number.
 *
 * @description After a phone number is locked, the locked phone number cannot be selected when you call an operation to create a binding.
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request LockSecretNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LockSecretNoResponse
 */
async function lockSecretNoWithOptions(request: LockSecretNoRequest, runtime: Util.RuntimeOptions): LockSecretNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LockSecretNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Locks a phone number.
 *
 * @description After a phone number is locked, the locked phone number cannot be selected when you call an operation to create a binding.
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request LockSecretNoRequest
 * @return LockSecretNoResponse
 */
async function lockSecretNo(request: LockSecretNoRequest): LockSecretNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return lockSecretNoWithOptions(request, runtime);
}

model OperateAxgGroupRequest {
  groupId?: long(name='GroupId', description='The group ID in the AXG binding.

You can view the group ID by using either of the following methods:

*   On the **Number Pool Management** page in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account), filter AXG private numbers and click **Number Group G Management** to view the group IDs of number groups G.****
*   If the [CreateAxgGroup](https://help.aliyun.com/document_detail/110250.html) operation is called to create number group G, the value of **GroupId** in the response of the CreateAxgGroup operation is specified as the value of the request parameter **GroupId** of the OperateAxgGroup operation.

>  Number group G must have one or more phone numbers.

This parameter is required.', example='1234'),
  numbers?: string(name='Numbers', description='The phone numbers that you add to number group G. Separate the phone numbers with commas (,). You can add up to 200 phone numbers at a time.

This parameter is required.', example='1390000****,1380000****'),
  operateType?: string(name='OperateType', description='The type of the operation on number group G. Valid values:

*   **addNumbers**: adds phone numbers to number group G.
*   **deleteNumbers**: deletes phone numbers from number group G.
*   **overwriteNumbers**: replaces all phone numbers in number group G. All the original phone numbers are deleted from number group G, and new phone numbers are added to number group G.

> 

*   When you replace all phone numbers in number group G, the quantity of original phone numbers in number group G cannot exceed 200.

*   You can add up to 200 phone numbers to number group G at a time.

This parameter is required.', example='addNumbers'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model OperateAxgGroupResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='986BCB6D-C9BF-42F9-91CE-3A9901233D36'),
}

model OperateAxgGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateAxgGroupResponseBody(name='body'),
}

/**
 * @summary Modifies number group G.
 *
 * @description After you create number group G, you can call the OperateAxgGroup operation to modify number group G. For example, you can add phone numbers to number group G, delete phone numbers from number group G, and replace all phone numbers in number group G.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request OperateAxgGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateAxgGroupResponse
 */
async function operateAxgGroupWithOptions(request: OperateAxgGroupRequest, runtime: Util.RuntimeOptions): OperateAxgGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.numbers)) {
    query['Numbers'] = request.numbers;
  }
  if (!Util.isUnset(request.operateType)) {
    query['OperateType'] = request.operateType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OperateAxgGroup',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies number group G.
 *
 * @description After you create number group G, you can call the OperateAxgGroup operation to modify number group G. For example, you can add phone numbers to number group G, delete phone numbers from number group G, and replace all phone numbers in number group G.
 * ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request OperateAxgGroupRequest
 * @return OperateAxgGroupResponse
 */
async function operateAxgGroup(request: OperateAxgGroupRequest): OperateAxgGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return operateAxgGroupWithOptions(request, runtime);
}

model OperateBlackNoRequest {
  blackNo?: string(name='BlackNo', description='The phone number to be added to or deleted from the blacklist.

This parameter is required.', example='150****0000'),
  operateType?: string(name='OperateType', description='The type of the operation on the phone number. Valid values:

*   **AddBlack**: adds the phone number to the blacklist.
*   **DeleteBlack**: deletes the phone number from the blacklist.

This parameter is required.', example='AddBlack'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC123456****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tips?: string(name='Tips', description='The description.', example='abcdef'),
}

model OperateBlackNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='2D1AEB96-96D0-454E-B0DC-AE2A8DF08020'),
}

model OperateBlackNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateBlackNoResponseBody(name='body'),
}

/**
 * @summary Adds a phone number to a blacklist or deletes a phone number from a blacklist.
 *
 * @description The OperateBlackNo operation supports the following number pool types: AXN, AXN extension, and 95AXN.
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request OperateBlackNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateBlackNoResponse
 */
async function operateBlackNoWithOptions(request: OperateBlackNoRequest, runtime: Util.RuntimeOptions): OperateBlackNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blackNo)) {
    query['BlackNo'] = request.blackNo;
  }
  if (!Util.isUnset(request.operateType)) {
    query['OperateType'] = request.operateType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tips)) {
    query['Tips'] = request.tips;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OperateBlackNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds a phone number to a blacklist or deletes a phone number from a blacklist.
 *
 * @description The OperateBlackNo operation supports the following number pool types: AXN, AXN extension, and 95AXN.
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request OperateBlackNoRequest
 * @return OperateBlackNoResponse
 */
async function operateBlackNo(request: OperateBlackNoRequest): OperateBlackNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return operateBlackNoWithOptions(request, runtime);
}

model QueryAxbBindFixedLineRequest {
  appId?: string(name='AppId', description='应用id

This parameter is required.', example='ALPT_1234'),
  orderId?: string(name='OrderId', description='业务id，消息请求标识

This parameter is required.', example='3ererrrdrrrr'),
  ownerId?: long(name='OwnerId'),
  phone?: string(name='Phone', description='A/B号码，queryType=1时，必传', example='示例值'),
  queryType?: string(name='QueryType', description='查询类型 0：根据绑定id查询 1：根据X和A/B号码查询

This parameter is required.', example='0'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id， queryType=0时，必传', example='A20304o0200303004j'),
  telX?: string(name='TelX', description='x号码，queryType=1时，必传', example='示例值示例值示例值'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20161114143116001'),
}

model QueryAxbBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  code?: string(name='Code', description='响应码', example='0'),
  data?: {
    anucode?: string(name='Anucode', description='接通前放音编码，放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3', example='10001,10002,10003'),
    anucodecalled?: string(name='Anucodecalled', description='接通后被叫侧放音编码', example='10001,10002'),
    areacode?: string(name='Areacode', description='隐私号码区号', example='010'),
    expiration?: string(name='Expiration', description='绑定过期时间', example='60'),
    extra?: {
      callrecording?: string(name='Callrecording', description='录音控制，仅下列值有效。默认是0（不开通录音功能）。 0：不录音 1：录音', example='1'),
    }(name='Extra', description='额外字段'),
    remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='19394'),
    subid?: string(name='Subid', description='绑定id', example='GHX0534X202504221531579290029-2-1-aliaxb'),
    subts?: string(name='Subts', description='绑定时间，格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。', example='20250421141723'),
    TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码', example='示例值示例值'),
    telA?: string(name='TelA', description='A号码', example='15500001111'),
    telB?: string(name='TelB', description='B号码', example='15500002222'),
    telX?: string(name='TelX', description='小号号码', example='19700002222'),
  }(name='Data', description='绑定信息'),
  message?: string(name='Message', description='描述信息', example='success'),
  requestId?: string(name='RequestId', example='3179F199-C6C5-5963-85A6-21CBA2F47592'),
  success?: boolean(name='Success', description='处理是否成功 true-成功', example='true'),
}

model QueryAxbBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAxbBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 固话AxB查询
 *
 * @param request QueryAxbBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAxbBindFixedLineResponse
 */
async function queryAxbBindFixedLineWithOptions(request: QueryAxbBindFixedLineRequest, runtime: Util.RuntimeOptions): QueryAxbBindFixedLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAxbBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 固话AxB查询
 *
 * @param request QueryAxbBindFixedLineRequest
 * @return QueryAxbBindFixedLineResponse
 */
async function queryAxbBindFixedLine(request: QueryAxbBindFixedLineRequest): QueryAxbBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAxbBindFixedLineWithOptions(request, runtime);
}

model QueryAxnBindFixedLineRequest {
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  phone?: string(name='Phone', description='A号码，queryType=1时，必传', example='15500001111'),
  queryType?: string(name='QueryType', description='查询类型 0：根据绑定id查询 1：根据A号码查询 2：根据X查询

This parameter is required.', example='0'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id queryType=0时，必传', example='GHX0534X202504221531579290029-2-1-aliaxn'),
  telX?: string(name='TelX', description='隐私号码', example='05718950'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model QueryAxnBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  code?: string(name='Code', description='响应码', example='0'),
  data?: [ 
    {
      anucode?: string(name='Anucode', description='接通前放音啊编码', example='10001,10002,10003'),
      anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码', example='10001,10002'),
      areacode?: string(name='Areacode', description='隐私号码区号', example='010'),
      expiration?: string(name='Expiration', description='过期时间', example='60'),
      extra?: {
        callback?: string(name='Callback', description='A通过X呼叫，即A主叫X，仅下列值有效。默认是0。 0：不能外呼 1：接续最近的N号码 2：回拨固定号码：telB', example='1'),
        callrecording?: string(name='Callrecording', description='录音控制，仅下列值有效。默认是0（不开通录音功能）。 0：不录音 1：录音', example='1'),
      }(name='Extra', description='额外字段'),
      remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='12444'),
      subid?: string(name='Subid', description='绑定id', example='GHX0534X202504221531579290029-2-1-aliaxn'),
      subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。', example='20250421141723'),
      TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码', example='10001,10002'),
      telA?: string(name='TelA', description='A号码', example='15500001111'),
      telB?: string(name='TelB', description='N号码', example='15500002222'),
      telX?: string(name='TelX', description='隐私号码', example='057112345678'),
    }
  ](name='Data', description='绑定对象'),
  message?: string(name='Message', description='描述信息', example='success'),
  requestId?: string(name='RequestId', example='E8B9C3ED-D9BD-5E27-9588-6D84D3070160'),
  success?: boolean(name='Success', example='false'),
}

model QueryAxnBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAxnBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 查询Axn绑定关系
 *
 * @param request QueryAxnBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAxnBindFixedLineResponse
 */
async function queryAxnBindFixedLineWithOptions(request: QueryAxnBindFixedLineRequest, runtime: Util.RuntimeOptions): QueryAxnBindFixedLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAxnBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询Axn绑定关系
 *
 * @param request QueryAxnBindFixedLineRequest
 * @return QueryAxnBindFixedLineResponse
 */
async function queryAxnBindFixedLine(request: QueryAxnBindFixedLineRequest): QueryAxnBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAxnBindFixedLineWithOptions(request, runtime);
}

model QueryAxnExtensionBindFixedLineRequest {
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  queryType?: string(name='QueryType', description='查询类型 0：根据绑定id查询 1：根据A号码查询

This parameter is required.', example='0'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id，queryType=0时，必传', example='可参考绑定响应'),
  telA?: string(name='TelA', description='A号码，queryType=1时，必传', example='15500001111'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model QueryAxnExtensionBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  code?: string(name='Code', description='响应码', example='0'),
  data?: [ 
    {
      anucode?: string(name='Anucode', description='放音编码', example='10001,10002,10003'),
      anucodecalled?: string(name='Anucodecalled', description='被叫侧放音', example='10001,10002'),
      areacode?: string(name='Areacode', description='隐私号码区号', example='10'),
      expiration?: string(name='Expiration', description='过期时间', example='60'),
      extraaxx?: {
        callback?: string(name='Callback', description='回拨控制', example='示例值示例值'),
        callrecording?: string(name='Callrecording', description='录音控制', example='示例值示例值'),
      }(name='Extraaxx', description='额外字段'),
      remark?: string(name='Remark', description='接入商自有字段', example='12444'),
      subid?: string(name='Subid', description='绑定ID', example='可参考绑定响应'),
      subts?: string(name='Subts', description='绑定时间', example='20250421141723'),
      TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码', example='10001,10002'),
      telA?: string(name='TelA', description='A号码', example='15500001111'),
      telX?: string(name='TelX', description='小号号码', example='19700002222'),
      telXext?: string(name='TelXext', description='分机号', example='1009'),
    }
  ](name='Data', description='查询绑定对象集合，具体对象字段见绑定请求'),
  message?: string(name='Message', description='描述信息', example='success'),
  requestId?: string(name='RequestId', example='74EFA0E8-CFCA-54D9-BFE5-904F9FA88DBD'),
  success?: boolean(name='Success', example='true'),
}

model QueryAxnExtensionBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAxnExtensionBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 查询AXN分机号绑定关系
 *
 * @param request QueryAxnExtensionBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAxnExtensionBindFixedLineResponse
 */
async function queryAxnExtensionBindFixedLineWithOptions(request: QueryAxnExtensionBindFixedLineRequest, runtime: Util.RuntimeOptions): QueryAxnExtensionBindFixedLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAxnExtensionBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询AXN分机号绑定关系
 *
 * @param request QueryAxnExtensionBindFixedLineRequest
 * @return QueryAxnExtensionBindFixedLineResponse
 */
async function queryAxnExtensionBindFixedLine(request: QueryAxnExtensionBindFixedLineRequest): QueryAxnExtensionBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAxnExtensionBindFixedLineWithOptions(request, runtime);
}

model QueryPhoneNoAByTrackNoRequest {
  cabinetNo?: string(name='CabinetNo', description='The cabinet number.', example='25689****'),
  ownerId?: long(name='OwnerId'),
  phoneNoX?: string(name='PhoneNoX', description='Phone number X returned by the API operation for creating a binding.', example='1710000****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  trackNo?: string(name='trackNo', description='The tracking number.

This parameter is required.', example='22573****'),
}

model QueryPhoneNoAByTrackNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  module?: [ 
    {
      extension?: string(name='Extension', description='The extension of phone number X.', example='130'),
      phoneNoA?: string(name='PhoneNoA', description='Phone number A.', example='1310000****'),
      phoneNoX?: string(name='PhoneNoX', description='The private number, that is, phone number X.', example='1710000****'),
    }
  ](name='Module', description='The information returned after the phone numbers were bound.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8906582E-6722'),
}

model QueryPhoneNoAByTrackNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPhoneNoAByTrackNoResponseBody(name='body'),
}

/**
 * @summary Queries the details about a tracking number.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QueryPhoneNoAByTrackNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPhoneNoAByTrackNoResponse
 */
async function queryPhoneNoAByTrackNoWithOptions(request: QueryPhoneNoAByTrackNoRequest, runtime: Util.RuntimeOptions): QueryPhoneNoAByTrackNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cabinetNo)) {
    query['CabinetNo'] = request.cabinetNo;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.trackNo)) {
    query['trackNo'] = request.trackNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPhoneNoAByTrackNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details about a tracking number.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QueryPhoneNoAByTrackNoRequest
 * @return QueryPhoneNoAByTrackNoResponse
 */
async function queryPhoneNoAByTrackNo(request: QueryPhoneNoAByTrackNoRequest): QueryPhoneNoAByTrackNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPhoneNoAByTrackNoWithOptions(request, runtime);
}

model QueryRecordFileDownloadUrlRequest {
  callId?: string(name='CallId', description='The ID of the call record. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view **Call Record ID** on the **Call Record Query** page.

This parameter is required.', example='abcedf1234'),
  callTime?: string(name='CallTime', description='The call initiation time in the call record. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account). View **Call Initiated At** on the **Call Record Query** page, or view the call_time field in the Call Detail Record (CDR) receipt.', example='2019-03-05 12:00:00'),
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

>  This parameter is required when **ProductType** is left empty.', example='FC123456'),
  productType?: string(name='ProductType', description='The product type. Valid values:

*   **AXB_170**.
*   **AXN_170**.
*   **AXN_95**.
*   **AXN_EXTENSION_REUSE**

> 

*   This parameter is applicable to the original key accounts of Alibaba Cloud. This parameter can be ignored for Alibaba Cloud users.

*   This parameter is required when **PoolKey** is left empty.', example='AXB_170'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryRecordFileDownloadUrlResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  downloadUrl?: string(name='DownloadUrl', description='The download URL of the recording file. The download URL is valid for 2 hours.', example='http://secret-axb-reco****cn-shanghai.aliyuncs.com/1000000820257625_66647243838006067251551752068865.mp3?Expires=155175****&OSSAccessKeyId=LTAIP00vvvv****v&Signature=tK6Yq9KusU4n%2BZ****7lg4/WmEA%3D'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AB3CEF7-DCBE-488C-9C33-D180982CE031'),
}

model QueryRecordFileDownloadUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRecordFileDownloadUrlResponseBody(name='body'),
}

/**
 * @summary Obtains the download URL of a recording file.
 *
 * @description If the recording feature is enabled for a binding, all calls made by the bound phone numbers are recorded. You can obtain the download URL of a recording file by calling the QueryRecordFileDownloadUrl operation and download the recording file.
 * >  We recommend that you subscribe to [the recording status report SecretRecording](https://help.aliyun.com/document_detail/109198.html). The values of the response parameters in SecretRecording can be used as the values of the request parameters for downloading a recording file.
 * ### [](#)Procedure for obtaining a recording file
 * 1.  Specify the request parameter in an update or binding operation to enable the recording feature.
 * 2.  Subscribe to recording message receipts in the Phone Number Protection console.
 * 3.  After a recording message receipt is returned, call the QueryRecordFileDownloadUrl operation to obtain the download URL of the recording file, and download the recording file.
 * > 
 * *   A download URL is valid for 2 hours. Download the recording file as soon as possible after obtaining a download URL.
 * *   The storage period of recording files is 30 days. You can download only the recording files of calls recorded in the last 30 days.
 *
 * @param request QueryRecordFileDownloadUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRecordFileDownloadUrlResponse
 */
async function queryRecordFileDownloadUrlWithOptions(request: QueryRecordFileDownloadUrlRequest, runtime: Util.RuntimeOptions): QueryRecordFileDownloadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.callTime)) {
    query['CallTime'] = request.callTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRecordFileDownloadUrl',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the download URL of a recording file.
 *
 * @description If the recording feature is enabled for a binding, all calls made by the bound phone numbers are recorded. You can obtain the download URL of a recording file by calling the QueryRecordFileDownloadUrl operation and download the recording file.
 * >  We recommend that you subscribe to [the recording status report SecretRecording](https://help.aliyun.com/document_detail/109198.html). The values of the response parameters in SecretRecording can be used as the values of the request parameters for downloading a recording file.
 * ### [](#)Procedure for obtaining a recording file
 * 1.  Specify the request parameter in an update or binding operation to enable the recording feature.
 * 2.  Subscribe to recording message receipts in the Phone Number Protection console.
 * 3.  After a recording message receipt is returned, call the QueryRecordFileDownloadUrl operation to obtain the download URL of the recording file, and download the recording file.
 * > 
 * *   A download URL is valid for 2 hours. Download the recording file as soon as possible after obtaining a download URL.
 * *   The storage period of recording files is 30 days. You can download only the recording files of calls recorded in the last 30 days.
 *
 * @param request QueryRecordFileDownloadUrlRequest
 * @return QueryRecordFileDownloadUrlResponse
 */
async function queryRecordFileDownloadUrl(request: QueryRecordFileDownloadUrlRequest): QueryRecordFileDownloadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRecordFileDownloadUrlWithOptions(request, runtime);
}

model QuerySecretAPhoneNoToCustRequest {
  ANoWhiteGroupId?: long(name='ANoWhiteGroupId', description='号码组ID

This parameter is required.', example='58'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='A号码

This parameter is required.', example='130*****8888'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QuerySecretAPhoneNoToCustResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='请求状态码', example='200'),
  data?: {
    ANoWhiteGroupId?: string(name='ANoWhiteGroupId', description='所属a号码组id', example='19'),
    custPhoneNo?: string(name='CustPhoneNo', description='固话报备的经办人/法人电话', example='130*****8888'),
    noType?: string(name='NoType', description='号码类型', example='Mobile'),
    phoneNoA?: string(name='PhoneNoA', description='A号码', example='130*****1234'),
    remark?: string(name='Remark', description='备注（客户自己的业务备注，可编辑）', example='***报备'),
    reportResult?: string(name='ReportResult', description='报备失败原因', example='["系统判断为不同人"]'),
    reportStatus?: string(name='ReportStatus', description='报备结果', example='REVIEWING'),
  }(name='Data', description='A号码报备状态查询结构体'),
  message?: string(name='Message', description='失败错误提示', example='号码组不存在'),
  requestId?: string(name='RequestId', description='返回id', example='1D73E648-0978-18A5-B089-3BB2'),
  success?: boolean(name='Success', description='请求是否成功', example='true'),
}

model QuerySecretAPhoneNoToCustResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySecretAPhoneNoToCustResponseBody(name='body'),
}

/**
 * @summary A号码报备状态查询
 *
 * @param request QuerySecretAPhoneNoToCustRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySecretAPhoneNoToCustResponse
 */
async function querySecretAPhoneNoToCustWithOptions(request: QuerySecretAPhoneNoToCustRequest, runtime: Util.RuntimeOptions): QuerySecretAPhoneNoToCustResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ANoWhiteGroupId)) {
    query['ANoWhiteGroupId'] = request.ANoWhiteGroupId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySecretAPhoneNoToCust',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary A号码报备状态查询
 *
 * @param request QuerySecretAPhoneNoToCustRequest
 * @return QuerySecretAPhoneNoToCustResponse
 */
async function querySecretAPhoneNoToCust(request: QuerySecretAPhoneNoToCustRequest): QuerySecretAPhoneNoToCustResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecretAPhoneNoToCustWithOptions(request, runtime);
}

model QuerySecretNoDetailRequest {
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC2258****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The private number.

This parameter is required.', example='1390000****'),
}

model QuerySecretNoDetailResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='066E6E47-04CB-4774-A976-4F73CB76D4A3'),
  secretNoInfoDTO?: {
    certifyStatus?: int32(name='CertifyStatus', description='The verification status of the phone number. Valid values:

*   **0**: The phone number is not verified.
*   **1**: The phone number is verified.', example='0'),
    city?: string(name='City', description='The city.', example='chengdu'),
    province?: string(name='Province', description='The province.', example='sichuan'),
    purchaseTime?: string(name='PurchaseTime', description='The time when the phone number was purchased.', example='2021-12-03 15:19:27'),
    secretStatus?: long(name='SecretStatus', description='The status of the phone number. Valid values:

*   **0**: The phone number is not bound to other phone numbers.
*   **1**: The phone number is bound to other phone numbers.
*   **2**: The phone number is locked.
*   **3**: The phone number is frozen.', example='0'),
    vendor?: long(name='Vendor', description='The carrier to which the phone number belongs. Valid values:

*   **1**: China Mobile
*   **2**: China Unicom
*   **3**: China Telecom', example='1'),
  }(name='SecretNoInfoDTO', description='The attributes of the phone number.'),
}

model QuerySecretNoDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySecretNoDetailResponseBody(name='body'),
}

/**
 * @summary Queries the attributes of a private number.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QuerySecretNoDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySecretNoDetailResponse
 */
async function querySecretNoDetailWithOptions(request: QuerySecretNoDetailRequest, runtime: Util.RuntimeOptions): QuerySecretNoDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySecretNoDetail',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the attributes of a private number.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. We recommend that you take note of the limit when you call this operation.
 *
 * @param request QuerySecretNoDetailRequest
 * @return QuerySecretNoDetailResponse
 */
async function querySecretNoDetail(request: QuerySecretNoDetailRequest): QuerySecretNoDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecretNoDetailWithOptions(request, runtime);
}

model QuerySecretNoRemainRequest {
  city?: string(name='City', description='The home location of the phone number.

*   If **SpecId** is set to 1 or 2, you can specify the **City** parameter to query the quantity of available phone numbers.

1.  You can enter a single city name to perform a query.
2.  You can enter National to query the quantity of remaining phone numbers available in the Chinese mainland for online purchase.
3.  You can enter National List to query the cities with available phone numbers and the quantities of remaining phone numbers in the Chinese mainland. Cities without available phone numbers will not be returned.

*   If **SpecId** is set to 3, home locations are not distinguished for phone numbers that start with 95 and only the quantity of all the remaining phone numbers that start with 95 and are available for online purchase can be queried. If SpecId is set to 3, **City** must be set to **Nationwide**.

>  Home locations can be set to only locations in the Chinese mainland.

This parameter is required.', example='hangzhou'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The prefix of the phone number. When you call the QuerySecretNoRemain operation with **SecretNo** specified, the quantity of remaining phone numbers with the specified prefix that are available for online purchase is queried.

Up to 18 digits of a phone number prefix can be specified.', example='130'),
  specId?: long(name='SpecId', description='The type of the phone number. Valid values:

*   **1**: a phone number assigned by a virtual network operator, that is, a phone number that belongs to the 170 or 171 number segment.
*   **2**: a phone number provided by a carrier.
*   **3**: a phone number that starts with 95.

This parameter is required.', example='1'),
}

model QuerySecretNoRemainResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='9FC30594-3841-43AD-9008-03393BCB5CD2'),
  secretRemainDTO?: {
    amount?: long(name='Amount', description='The quantity of remaining phone numbers available for online purchase.', example='0'),
    city?: string(name='City', description='The home location of the phone numbers.', example='hangzhou'),
    remainDTOList?: {
      remainDTO?: [ 
      {
        amount?: long(name='Amount', description='The quantity of remaining phone numbers available for online purchase for the city.', example='120'),
        city?: string(name='City', description='The home location of the phone numbers.', example='Wuhan'),
      }
    ](name='remainDTO')
    }(name='RemainDTOList', description='The information about remaining phone numbers available for online purchase.'),
  }(name='SecretRemainDTO', description='The information returned after the operation was called.'),
}

model QuerySecretNoRemainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySecretNoRemainResponseBody(name='body'),
}

/**
 * @summary Queries the quantity of remaining phone numbers available for online purchase.
 *
 * @description When purchasing a phone number, specify the home location. If no sufficient phone numbers are available for purchase in the home location, the purchase of the phone number fails. Before calling the [BuySecretNo](~~BuySecretNo~~) operation to purchase a phone number, call the [QuerySecretNoRemain](~~QuerySecretNoRemain~~) operation to query the quantity of remaining phone numbers available for online purchase.
 *
 * @param request QuerySecretNoRemainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySecretNoRemainResponse
 */
async function querySecretNoRemainWithOptions(request: QuerySecretNoRemainRequest, runtime: Util.RuntimeOptions): QuerySecretNoRemainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  if (!Util.isUnset(request.specId)) {
    query['SpecId'] = request.specId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySecretNoRemain',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the quantity of remaining phone numbers available for online purchase.
 *
 * @description When purchasing a phone number, specify the home location. If no sufficient phone numbers are available for purchase in the home location, the purchase of the phone number fails. Before calling the [BuySecretNo](~~BuySecretNo~~) operation to purchase a phone number, call the [QuerySecretNoRemain](~~QuerySecretNoRemain~~) operation to query the quantity of remaining phone numbers available for online purchase.
 *
 * @param request QuerySecretNoRemainRequest
 * @return QuerySecretNoRemainResponse
 */
async function querySecretNoRemain(request: QuerySecretNoRemainRequest): QuerySecretNoRemainResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecretNoRemainWithOptions(request, runtime);
}

model QuerySoundRecordRequest {
  callId?: string(name='CallId', description='本次呼叫唯一id

This parameter is required.', example='ac445343254'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QuerySoundRecordResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
  data?: {
    fileUrl?: string(name='FileUrl', description='通话录音url路径，最大长度1000，有效期1小时', example='http://www.oss.com/temepl/a.mp3'),
  }(name='Data'),
  message?: string(name='Message', description='返回信息', example='成功'),
  success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
}

model QuerySoundRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySoundRecordResponseBody(name='body'),
}

/**
 * @summary 查询通话录音链接
 *
 * @param request QuerySoundRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySoundRecordResponse
 */
async function querySoundRecordWithOptions(request: QuerySoundRecordRequest, runtime: Util.RuntimeOptions): QuerySoundRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callId)) {
    query['CallId'] = request.callId;
  }
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySoundRecord',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询通话录音链接
 *
 * @param request QuerySoundRecordRequest
 * @return QuerySoundRecordResponse
 */
async function querySoundRecord(request: QuerySoundRecordRequest): QuerySoundRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySoundRecordWithOptions(request, runtime);
}

model QuerySubsIdRequest {
  ownerId?: long(name='OwnerId'),
  phoneNoX?: string(name='PhoneNoX', description='The private number in the binding, that is, phone number X.

This parameter is required.', example='1390000****'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dyplsnext.console.aliyun.com/overview) and view the key of the phone number pool on the Number Pool Management page.', example='FC123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QuerySubsIdResponseBody = {
  code?: string(name='Code', description='The response code. The value OK indicates that the request was successful.', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='E7F99446-8191-43C0-99B5-F58A6AEAD779'),
  subsId?: string(name='SubsId', description='The binding ID.', example='11111111****'),
}

model QuerySubsIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySubsIdResponseBody(name='body'),
}

/**
 * @summary Queries binding IDs.
 *
 * @description You can query binding IDs by phone number X. In the AXB product, multiple bindings may exist for the same phone number X. In this case, multiple binding IDs may be obtained for the same phone number X.
 *
 * @param request QuerySubsIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySubsIdResponse
 */
async function querySubsIdWithOptions(request: QuerySubsIdRequest, runtime: Util.RuntimeOptions): QuerySubsIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySubsId',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries binding IDs.
 *
 * @description You can query binding IDs by phone number X. In the AXB product, multiple bindings may exist for the same phone number X. In this case, multiple binding IDs may be obtained for the same phone number X.
 *
 * @param request QuerySubsIdRequest
 * @return QuerySubsIdResponse
 */
async function querySubsId(request: QuerySubsIdRequest): QuerySubsIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySubsIdWithOptions(request, runtime);
}

model QuerySubscriptionDetailRequest {
  ownerId?: long(name='OwnerId'),
  phoneNoX?: string(name='PhoneNoX', description='The private number in the binding, that is, phone number X.

This parameter is required.', example='13900001234'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

>  This parameter is required when **ProductType** is left empty.', example='FC123456'),
  productType?: string(name='ProductType', description='The product type. Valid values:

*   **AXB_170**
*   **AXN_170**
*   **AXN_95**
*   **AXN_EXTENSION_REUSE**

> 

*   This parameter is applicable to the original key accounts of Alibaba Cloud. This parameter can be ignored for Alibaba Cloud users.

*   This parameter is required when **PoolKey** is left empty.', example='AXB_170'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subsId?: string(name='SubsId', description='The binding ID.

Log on to the Phone Number Protection console, choose **Number and Number Pool** > **Number Management**. On the Number Management page, select the desired record and click Details to view the binding ID. Alternatively, you can view the value of the **SubsId** parameter returned by an API operation for a phone number binding such as [BindAxb](https://help.aliyun.com/document_detail/110248.html). The value of this parameter indicates a binding ID.

This parameter is required.', example='100000076879****'),
}

model QuerySubscriptionDetailResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='066E6E47-04CB-4774-A976-4F73CB76D4A3'),
  secretBindDetailDTO?: {
    ASRModelId?: string(name='ASRModelId', description='The ID of the ASR model.', example='123456'),
    ASRStatus?: boolean(name='ASRStatus', description='Indicates whether automatic speech recognition (ASR) is enabled. Valid values:

*   **false**: ASR is disabled.
*   **true**: ASR is enabled.', example='true'),
    callRestrict?: string(name='CallRestrict', description='The status of one-way call restrictions. No value is returned for this parameter if one-way call restrictions are not set. Valid values:

*   **CONTROL_AX_DISABLE**: Phone number A cannot be used to call phone number X.
*   **CONTROL_BX_DISABLE**: Phone number B cannot be used to call phone number X.', example='CONTROL_BX_DISABLE'),
    expireDate?: string(name='ExpireDate', description='The expiration time of the binding.', example='2019-09-05 12:00:00'),
    extension?: string(name='Extension', description='The extension in the AXG extension binding.', example='130'),
    gmtCreate?: string(name='GmtCreate', description='The creation time of the binding.', example='2019-03-05 12:00:00'),
    groupId?: long(name='GroupId', description='The ID of number group G in the binding.', example='2000000130001'),
    needRecord?: boolean(name='NeedRecord', description='Indicates whether all calls made by the bound phone numbers are recorded. Valid values:

*   **false**
*   **true**', example='true'),
    phoneNoA?: string(name='PhoneNoA', description='Phone number A in the binding.', example='13900001111'),
    phoneNoB?: string(name='PhoneNoB', description='Phone number B in the binding.', example='13900002222'),
    phoneNoX?: string(name='PhoneNoX', description='The private number in the binding, that is, phone number X.', example='13900001234'),
    status?: long(name='Status', description='The binding status. Valid values:

*   **0**: The binding expired.
*   **1**: The binding is in effect.', example='1'),
    subsId?: string(name='SubsId', description='The binding ID.', example='100000076879****'),
  }(name='SecretBindDetailDTO', description='The information returned after the QuerySubscriptionDetail operation was called.'),
}

model QuerySubscriptionDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QuerySubscriptionDetailResponseBody(name='body'),
}

/**
 * @summary Queries the details about a phone number binding.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 * ### [](#poolkeyproducttype)Limits on PoolKey and ProductType
 * You must specify either PoolKey or ProductType. If both parameters are not specified, an error is reported when you call the QuerySubscriptionDetail operation. We recommend that you specify the ProductType parameter for the original key accounts of Alibaba Cloud and the PoolKey parameter for Alibaba Cloud users.
 *
 * @param request QuerySubscriptionDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QuerySubscriptionDetailResponse
 */
async function querySubscriptionDetailWithOptions(request: QuerySubscriptionDetailRequest, runtime: Util.RuntimeOptions): QuerySubscriptionDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subsId)) {
    query['SubsId'] = request.subsId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySubscriptionDetail',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details about a phone number binding.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 * ### [](#poolkeyproducttype)Limits on PoolKey and ProductType
 * You must specify either PoolKey or ProductType. If both parameters are not specified, an error is reported when you call the QuerySubscriptionDetail operation. We recommend that you specify the ProductType parameter for the original key accounts of Alibaba Cloud and the PoolKey parameter for Alibaba Cloud users.
 *
 * @param request QuerySubscriptionDetailRequest
 * @return QuerySubscriptionDetailResponse
 */
async function querySubscriptionDetail(request: QuerySubscriptionDetailRequest): QuerySubscriptionDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySubscriptionDetailWithOptions(request, runtime);
}

model ReleaseSecretNoRequest {
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC123456'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The prefix of phone numbers. When you call the ReleaseSecretNo operation with **SecretNo** specified, the system performs fuzzy matching against phone numbers based on the prefix.

>  Up to 18 digits of a phone number prefix can be specified.

This parameter is required.', example='130'),
}

model ReleaseSecretNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='986BCB6D-C9BF-42F9-91CE-3A990121232'),
}

model ReleaseSecretNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseSecretNoResponseBody(name='body'),
}

/**
 * @summary Releases a phone number.
 *
 * @description *   After a phone number is released, it will no longer be charged from the following month.
 * *   Before you release a phone number, log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) to check whether the phone number is bound to other phone numbers. The phone number can be released only if it is not bound to other phone numbers.
 *
 * @param request ReleaseSecretNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseSecretNoResponse
 */
async function releaseSecretNoWithOptions(request: ReleaseSecretNoRequest, runtime: Util.RuntimeOptions): ReleaseSecretNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseSecretNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Releases a phone number.
 *
 * @description *   After a phone number is released, it will no longer be charged from the following month.
 * *   Before you release a phone number, log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) to check whether the phone number is bound to other phone numbers. The phone number can be released only if it is not bound to other phone numbers.
 *
 * @param request ReleaseSecretNoRequest
 * @return ReleaseSecretNoResponse
 */
async function releaseSecretNo(request: ReleaseSecretNoRequest): ReleaseSecretNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseSecretNoWithOptions(request, runtime);
}

model UnBindAXBRequest {
  bindId?: string(name='BindId', description='bindId绑定关系AXB唯一id

This parameter is required.', example='4534543'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UnBindAXBResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', example='0000'),
  data?: {
    code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
    message?: string(name='Message', description='返回信息', example='成功'),
    success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='true'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', example='true'),
}

model UnBindAXBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnBindAXBResponseBody(name='body'),
}

/**
 * @summary 解除指定的呼叫绑定关系（A，X，B），解决呼叫绑定关系后，员工B不能通过工作号X呼叫到客户A。
 *
 * @param request UnBindAXBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnBindAXBResponse
 */
async function unBindAXBWithOptions(request: UnBindAXBRequest, runtime: Util.RuntimeOptions): UnBindAXBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bindId)) {
    query['BindId'] = request.bindId;
  }
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnBindAXB',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解除指定的呼叫绑定关系（A，X，B），解决呼叫绑定关系后，员工B不能通过工作号X呼叫到客户A。
 *
 * @param request UnBindAXBRequest
 * @return UnBindAXBResponse
 */
async function unBindAXB(request: UnBindAXBRequest): UnBindAXBResponse {
  var runtime = new Util.RuntimeOptions{};
  return unBindAXBWithOptions(request, runtime);
}

model UnBindXBRequest {
  authId?: string(name='AuthId', description='authId绑定关系BX唯一id

This parameter is required.', example='34*****46'),
  callerParentId?: long(name='CallerParentId', description='客户uid', example='-'),
  customerPoolKey?: string(name='CustomerPoolKey', description='号码池key

This parameter is required.', example='FC5**********************a1a'),
  ownerId?: long(name='OwnerId'),
  reqId?: string(name='ReqId', description='请求去重ID, reqId最大长度为20位,接入方需要保持原子性

This parameter is required.', example='564**********879'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  telX?: string(name='TelX', description='X号码

This parameter is required.', example='17*******22'),
}

model UnBindXBResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='0'),
  code?: string(name='Code', example='0000'),
  data?: {
    code?: string(name='Code', description='返回状态码 0000表示成功 其他表示失败', example='0000'),
    message?: string(name='Message', description='返回信息', example='成功'),
    success?: boolean(name='Success', description='返回是否成功 true  表示成功 false表示失败', example='false'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', example='false'),
}

model UnBindXBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnBindXBResponseBody(name='body'),
}

/**
 * @summary 调用本接口可取消工作号X与员工号码B的绑定。绑定解除后，对X的呼叫都不会转接给B。
 *
 * @param request UnBindXBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnBindXBResponse
 */
async function unBindXBWithOptions(request: UnBindXBRequest, runtime: Util.RuntimeOptions): UnBindXBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authId)) {
    query['AuthId'] = request.authId;
  }
  if (!Util.isUnset(request.callerParentId)) {
    query['CallerParentId'] = request.callerParentId;
  }
  if (!Util.isUnset(request.customerPoolKey)) {
    query['CustomerPoolKey'] = request.customerPoolKey;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.reqId)) {
    query['ReqId'] = request.reqId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.telX)) {
    query['TelX'] = request.telX;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnBindXB',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 调用本接口可取消工作号X与员工号码B的绑定。绑定解除后，对X的呼叫都不会转接给B。
 *
 * @param request UnBindXBRequest
 * @return UnBindXBResponse
 */
async function unBindXB(request: UnBindXBRequest): UnBindXBResponse {
  var runtime = new Util.RuntimeOptions{};
  return unBindXBWithOptions(request, runtime);
}

model UnbindSubscriptionRequest {
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool. Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

>  This parameter is required when **ProductType** is left empty.', example='FC123456'),
  productType?: string(name='ProductType', description='The product type. Fixed value: **AXB_170**.

> 

*   This parameter is applicable to the original key accounts of Alibaba Cloud. This parameter can be ignored for Alibaba Cloud users.

*   This parameter is required when **PoolKey** is left empty.', example='AXB_170'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The private number, that is, phone number X specified in an API operation for a phone number binding such as [BindAXG](https://help.aliyun.com/document_detail/110249.html) or automatically assigned after such an operation is called.

This parameter is required.', example='1390000****'),
  subsId?: string(name='SubsId', description='The binding ID.

Log on to the Phone Number Protection console, choose **Number and Number Pool** > **Number Management**. On the Number Management page, select the desired record and click Details to view the binding ID. Alternatively, you can view the value of the **SubsId** parameter returned by an API operation for a phone number binding such as BindAxb. The value of this parameter indicates a binding ID.

This parameter is required.', example='1************2'),
}

model UnbindSubscriptionResponseBody = {
  chargeId?: string(name='ChargeId', description='A deprecated parameter.', example='true'),
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='986BCB6D-C9BF-42F9-91CE-3A9901233D36'),
}

model UnbindSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindSubscriptionResponseBody(name='body'),
}

/**
 * @summary Unbinds a phone number.
 *
 * @description Before releasing a phone number, you must call the UnbindSubscription operation to unbind the phone number.
 *
 * @param request UnbindSubscriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindSubscriptionResponse
 */
async function unbindSubscriptionWithOptions(request: UnbindSubscriptionRequest, runtime: Util.RuntimeOptions): UnbindSubscriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  if (!Util.isUnset(request.subsId)) {
    query['SubsId'] = request.subsId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindSubscription',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Unbinds a phone number.
 *
 * @description Before releasing a phone number, you must call the UnbindSubscription operation to unbind the phone number.
 *
 * @param request UnbindSubscriptionRequest
 * @return UnbindSubscriptionResponse
 */
async function unbindSubscription(request: UnbindSubscriptionRequest): UnbindSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindSubscriptionWithOptions(request, runtime);
}

model UnlockSecretNoRequest {
  ownerId?: long(name='OwnerId'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

This parameter is required.', example='FC2256****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secretNo?: string(name='SecretNo', description='The private number that you want to unlock. You must enter a complete mobile phone number.

This parameter is required.', example='1300000****'),
}

model UnlockSecretNoResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other status codes indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='2D1AEB96-96D0-454E-B0DC-AE2A8DF08020'),
}

model UnlockSecretNoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnlockSecretNoResponseBody(name='body'),
}

/**
 * @summary Unlocks a phone number.
 *
 * @description After a phone number is unlocked, you can reselect the unlocked phone number when you call an operation to create a binding.
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request UnlockSecretNoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnlockSecretNoResponse
 */
async function unlockSecretNoWithOptions(request: UnlockSecretNoRequest, runtime: Util.RuntimeOptions): UnlockSecretNoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secretNo)) {
    query['SecretNo'] = request.secretNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnlockSecretNo',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Unlocks a phone number.
 *
 * @description After a phone number is unlocked, you can reselect the unlocked phone number when you call an operation to create a binding.
 * ### [](#qps)QPS limits
 * You can call this operation up to 500 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request UnlockSecretNoRequest
 * @return UnlockSecretNoResponse
 */
async function unlockSecretNo(request: UnlockSecretNoRequest): UnlockSecretNoResponse {
  var runtime = new Util.RuntimeOptions{};
  return unlockSecretNoWithOptions(request, runtime);
}

model UpdateAxbBindFixedLineRequest {
  anucode?: string(name='Anucode', description='主叫侧放音编码', example='1,2,3'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码', example='1,2'),
  appId?: string(name='AppId', description='应用id，请求和绑定时的appId必须一致

This parameter is required.', example='ALPT_1234'),
  expiration?: string(name='Expiration', description='过期时间,单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期', example='10'),
  extra?: {
    callrecording?: string(name='Callrecording', description='录音控制， 0：不录音 1：录音', example='0'),
  }(name='Extra', description='扩展参数'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='1234567890'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，不能超过100个字符', example='remark'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='A100X558X0000400023'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20150920190126'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧的放音编码', example='1,2'),
  telA?: string(name='TelA', description='真实号码，telA,telB不允许同时更新', example='13900000000'),
  telB?: string(name='TelB', description='对端号码，telA,telB不允许同时更新', example='13005711234'),
  ts?: string(name='Ts', description='业务时间戳，格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20161114143116001'),
}

model UpdateAxbBindFixedLineShrinkRequest {
  anucode?: string(name='Anucode', description='主叫侧放音编码', example='1,2,3'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码', example='1,2'),
  appId?: string(name='AppId', description='应用id，请求和绑定时的appId必须一致

This parameter is required.', example='ALPT_1234'),
  expiration?: string(name='Expiration', description='过期时间,单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期', example='10'),
  extraShrink?: string(name='Extra', description='扩展参数'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='1234567890'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，不能超过100个字符', example='remark'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='A100X558X0000400023'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20150920190126'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧的放音编码', example='1,2'),
  telA?: string(name='TelA', description='真实号码，telA,telB不允许同时更新', example='13900000000'),
  telB?: string(name='TelB', description='对端号码，telA,telB不允许同时更新', example='13005711234'),
  ts?: string(name='Ts', description='业务时间戳，格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20161114143116001'),
}

model UpdateAxbBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', description='响应码 0-成功', example='0'),
    message?: string(name='Message', description='响应消息', example='success'),
    success?: boolean(name='Success', description='是否处理成功  true-成功', example='true'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='73A5C73A-1D97-54B6-B47C-541BE59F84D9'),
  success?: boolean(name='Success', example='True'),
}

model UpdateAxbBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAxbBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 固话AxB绑定更新
 *
 * @param tmpReq UpdateAxbBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAxbBindFixedLineResponse
 */
async function updateAxbBindFixedLineWithOptions(tmpReq: UpdateAxbBindFixedLineRequest, runtime: Util.RuntimeOptions): UpdateAxbBindFixedLineResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAxbBindFixedLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.anucode)) {
    query['Anucode'] = request.anucode;
  }
  if (!Util.isUnset(request.anucodecalled)) {
    query['Anucodecalled'] = request.anucodecalled;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extraShrink)) {
    query['Extra'] = request.extraShrink;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.subts)) {
    query['Subts'] = request.subts;
  }
  if (!Util.isUnset(request.TAnucodeConnect)) {
    query['TAnucodeConnect'] = request.TAnucodeConnect;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.telB)) {
    query['TelB'] = request.telB;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAxbBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 固话AxB绑定更新
 *
 * @param request UpdateAxbBindFixedLineRequest
 * @return UpdateAxbBindFixedLineResponse
 */
async function updateAxbBindFixedLine(request: UpdateAxbBindFixedLineRequest): UpdateAxbBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAxbBindFixedLineWithOptions(request, runtime);
}

model UpdateAxnBindFixedLineRequest {
  anucode?: string(name='Anucode', description='放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3。', example='示例值示例值示例值'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2。', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  expiration?: string(name='Expiration', description='位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期', example='60'),
  extra?: {
    callback?: string(name='Callback', description='A通过X呼叫，即A主叫X，仅下列值有效。默认是0。 0：不能外呼 1：接续最近的N号码 2：回拨固定号码：telB', example='0'),
    callrecording?: string(name='Callrecording', description='录音控制，仅下列值有效。默认是0（不开通录音功能）。 0：不录音 1：录音', example='1'),
  }(name='Extra', description='额外字段'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='1234'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='GHX0534X202504221531579290029-2-1-aliaxn'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723098'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码被叫为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码', example='15500001111'),
  telB?: string(name='TelB', description='B号码', example='15500002222'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model UpdateAxnBindFixedLineShrinkRequest {
  anucode?: string(name='Anucode', description='放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3。', example='示例值示例值示例值'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2。', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  expiration?: string(name='Expiration', description='位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期', example='60'),
  extraShrink?: string(name='Extra', description='额外字段'),
  orderId?: string(name='OrderId', description='消息请求唯一标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='1234'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='GHX0534X202504221531579290029-2-1-aliaxn'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723098'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码被叫为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码', example='15500001111'),
  telB?: string(name='TelB', description='B号码', example='15500002222'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model UpdateAxnBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='{}'),
  code?: string(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', description='响应码 0：成功，其它失败，具体见文档', example='0'),
    message?: string(name='Message', description='描述信息', example='success'),
    success?: boolean(name='Success', example='true'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='3FDD0A8F-34F1-5BD4-AF9F-CD90B3DE7C06'),
  success?: boolean(name='Success', example='True'),
}

model UpdateAxnBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAxnBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 更新Axn绑定关系
 *
 * @param tmpReq UpdateAxnBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAxnBindFixedLineResponse
 */
async function updateAxnBindFixedLineWithOptions(tmpReq: UpdateAxnBindFixedLineRequest, runtime: Util.RuntimeOptions): UpdateAxnBindFixedLineResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAxnBindFixedLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.anucode)) {
    query['Anucode'] = request.anucode;
  }
  if (!Util.isUnset(request.anucodecalled)) {
    query['Anucodecalled'] = request.anucodecalled;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extraShrink)) {
    query['Extra'] = request.extraShrink;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.subts)) {
    query['Subts'] = request.subts;
  }
  if (!Util.isUnset(request.TAnucodeConnect)) {
    query['TAnucodeConnect'] = request.TAnucodeConnect;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.telB)) {
    query['TelB'] = request.telB;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAxnBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新Axn绑定关系
 *
 * @param request UpdateAxnBindFixedLineRequest
 * @return UpdateAxnBindFixedLineResponse
 */
async function updateAxnBindFixedLine(request: UpdateAxnBindFixedLineRequest): UpdateAxnBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAxnBindFixedLineWithOptions(request, runtime);
}

model UpdateAxnExtensionBindFixedLineRequest {
  anucode?: string(name='Anucode', description='放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  AXN分机号业务的放音编码,B->X和其他号码->X的编码一致  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3', example='10001,10002,10003'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  expiration?: string(name='Expiration', description='单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期', example='60'),
  extraaxx?: {
    callback?: string(name='Callback', description='可选。 A通过X呼叫，即A主叫X，仅下列值有效。默认是0。 0：不能外呼 1：接续最近的B号码', example='0'),
    callrecording?: string(name='Callrecording', description='录音控制，仅下列值有效。默认是0（不开通录音功能）。 0：不录音 1：录音', example='0'),
  }(name='Extraaxx', description='AXx的扩展参数项'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='1233'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='可参考绑定响应'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723098'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码

This parameter is required.', example='15500001111'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model UpdateAxnExtensionBindFixedLineShrinkRequest {
  anucode?: string(name='Anucode', description='放音编码必须包含3个场景的编码。按照“B->X,A->X,其他号码->X”的顺序填写编码，编码之间以逗号分隔。  AXN分机号业务的放音编码,B->X和其他号码->X的编码一致  比如：“1,2,3”表示B->X放音编号为1，A->X放音编号为2， 其他号码->X放音编号为3', example='10001,10002,10003'),
  anucodecalled?: string(name='Anucodecalled', description='被叫侧放音编码  被叫放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫侧接听时的放音编号为1，其他号码为被叫侧接听时的放音编号为2', example='10001,10002'),
  appId?: string(name='AppId', description='业务id标识，由阿里云分配给客户侧

This parameter is required.', example='alitest'),
  expiration?: string(name='Expiration', description='单位：秒，必须为数字 0：不会自动解绑 非0：自动解绑周期', example='60'),
  extraaxxShrink?: string(name='Extraaxx', description='AXx的扩展参数项'),
  orderId?: string(name='OrderId', description='消息请求标识

This parameter is required.', example='12345dkwkd99d'),
  ownerId?: long(name='OwnerId'),
  remark?: string(name='Remark', description='接入商自有字段，最大100字符长度', example='1233'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subId?: string(name='SubId', description='绑定id

This parameter is required.', example='可参考绑定响应'),
  subts?: string(name='Subts', description='格式为yyyyMMddHHmmss。时间采用北京时间，24小时制。

This parameter is required.', example='20250421141723098'),
  TAnucodeConnect?: string(name='TAnucodeConnect', description='接通后主叫侧放音编码  接通后主叫侧放音编码必须包含2个场景的编码。按照“A被叫,其他号码被叫”的顺序填写编码，编码之间以逗号分隔。  比如：“1,2”表示A号码为被叫时主叫侧的放音编号为1，其他号码为被叫时主叫侧的放音编号为2', example='10001,10002'),
  telA?: string(name='TelA', description='A号码

This parameter is required.', example='15500001111'),
  ts?: string(name='Ts', description='格式yyyyMMddHHmmssSSS，时间采用北京时间，24小时制，精确至毫秒

This parameter is required.', example='20250421141723098'),
}

model UpdateAxnExtensionBindFixedLineResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='None'),
  code?: string(name='Code', example='OK'),
  data?: {
    code?: string(name='Code', description='响应码 0：成功，其它失败，具体见文档', example='0'),
    message?: string(name='Message', description='描述信息', example='success'),
    success?: boolean(name='Success', example='false'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='31031C54-7727-5057-9ED1-FA276B64205E'),
  success?: boolean(name='Success', example='True'),
}

model UpdateAxnExtensionBindFixedLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAxnExtensionBindFixedLineResponseBody(name='body'),
}

/**
 * @summary 更新AXN分机号绑定关系
 *
 * @param tmpReq UpdateAxnExtensionBindFixedLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAxnExtensionBindFixedLineResponse
 */
async function updateAxnExtensionBindFixedLineWithOptions(tmpReq: UpdateAxnExtensionBindFixedLineRequest, runtime: Util.RuntimeOptions): UpdateAxnExtensionBindFixedLineResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAxnExtensionBindFixedLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extraaxx)) {
    request.extraaxxShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extraaxx, 'Extraaxx', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.anucode)) {
    query['Anucode'] = request.anucode;
  }
  if (!Util.isUnset(request.anucodecalled)) {
    query['Anucodecalled'] = request.anucodecalled;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.extraaxxShrink)) {
    query['Extraaxx'] = request.extraaxxShrink;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subId)) {
    query['SubId'] = request.subId;
  }
  if (!Util.isUnset(request.subts)) {
    query['Subts'] = request.subts;
  }
  if (!Util.isUnset(request.TAnucodeConnect)) {
    query['TAnucodeConnect'] = request.TAnucodeConnect;
  }
  if (!Util.isUnset(request.telA)) {
    query['TelA'] = request.telA;
  }
  if (!Util.isUnset(request.ts)) {
    query['Ts'] = request.ts;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAxnExtensionBindFixedLine',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新AXN分机号绑定关系
 *
 * @param request UpdateAxnExtensionBindFixedLineRequest
 * @return UpdateAxnExtensionBindFixedLineResponse
 */
async function updateAxnExtensionBindFixedLine(request: UpdateAxnExtensionBindFixedLineRequest): UpdateAxnExtensionBindFixedLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAxnExtensionBindFixedLineWithOptions(request, runtime);
}

model UpdateSubscriptionRequest {
  ASRModelId?: string(name='ASRModelId', description='The ID of the ASR model.', example='980abddb908f48e8b987cb2cd303****'),
  ASRStatus?: boolean(name='ASRStatus', description='Specifies whether to enable automatic speech recognition (ASR). Valid values:

*   **false** (default): disables ASR.
*   **true**: enables ASR.', example='false'),
  callDisplayType?: int32(name='CallDisplayType', description='Re-sets the phone number display logic in the phone number binding. Fixed value: **1**, indicating that phone number X is displayed on both the calling phone and the called phone.

>  Due to the regulatory restrictions imposed by carriers, the setting to display real phone numbers during calls does not take effect.', example='1'),
  callRestrict?: string(name='CallRestrict', description='One-way call restrictions. Valid values:

*   **CONTROL_AX_DISABLE**: Phone number A cannot be used to call phone number X.
*   **CONTROL_BX_DISABLE**: Phone number B cannot be used to call phone number X.
*   **CONTROL_CLEAR_DISABLE**: The call restrictions are cleared.

>  This parameter is required when **OperateType** is set to **updateCallRestrict**.', example='CONTROL_BX_DISABLE'),
  expiration?: string(name='Expiration', description='Re-sets the expiration time of the phone number binding.

> 

*   This parameter is required when **OperateType** is set to **updateExpire**.

*   The expiration time must be more than 1 minute later than the time when you call this API operation.', example='2019-09-05 12:00:00'),
  groupId?: string(name='GroupId', description='The ID of number group G in the phone number binding.

>  This parameter is required when **OperateType** is set to **updateAxgGroup**.', example='1234'),
  isRecordingEnabled?: boolean(name='IsRecordingEnabled', description='Re-sets the recording status in the phone number binding.

>  This parameter does not have a default value. If you do not specify this parameter, the value of the corresponding field is not updated.', example='true'),
  operateType?: string(name='OperateType', description='The operation to modify the phone number binding. Valid values:

*   **updateNoA**: modifies phone number A.
*   **updateNoB**: modifies phone number B.
*   **updateExpire**: modifies the validity period of the binding.
*   **updateAxgGroup**: modifies number group G.
*   **updateCallRestrict**: modifies one-way call restrictions.
*   **updateCallDisplayType**: updates the number display logic for calls.
*   **updateOutId**: updates the value of the OutId parameter.
*   **updateIsRecordingEnabled**: updates the status of the recording feature in the binding.

This parameter is required.', example='updateNoA'),
  outId?: string(name='OutId', description='Re-sets the value of the OutId parameter in the phone number binding.', example='abcdef'),
  ownerId?: long(name='OwnerId'),
  phoneNoA?: string(name='PhoneNoA', description='Phone number A in the phone number binding.

>  This parameter is required when **OperateType** is set to **updateNoA**.', example='1390000****'),
  phoneNoB?: string(name='PhoneNoB', description='Phone number B in the phone number binding.

>  This parameter is required when **OperateType** is set to **updateNoB**.', example='1390000****'),
  phoneNoX?: string(name='PhoneNoX', description='Phone number X in the phone number binding.

This parameter is required.', example='1390000****'),
  poolKey?: string(name='PoolKey', description='The key of the phone number pool.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account) and view the key of the phone number pool on the **Number Pool Management** page.

>  This parameter is required when **ProductType** is left empty.', example='FC122356****'),
  productType?: string(name='ProductType', description='The product type. Valid values:

*   **AXB_170**
*   **AXN_170**
*   **AXN_95**
*   **AXN_EXTENSION_REUSE**

> 

*   This parameter is applicable to the original key accounts of Alibaba Cloud. This parameter can be ignored for Alibaba Cloud users.

*   This parameter is required when **PoolKey** is left empty.', example='AXB_170'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ringConfig?: string(name='RingConfig', description='Updates the ringtone code for enterprise Color Ring Back Tone (CRBT) in the phone number binding.

AXB product:

*   Ringtone setting when phone number A is used to call phone number X in the AXB binding: AXBRing_A
*   Ringtone setting when phone number B is used to call phone number X in the AXB binding: AXBRing_B

AXN product:

*   Ringtone setting (with a callback number) when phone number A is used to call phone number X in the AXN extension binding: AXNRing_AB
*   Ringtone setting (without a callback number) when phone number A is used to call phone number X in the AXN extension binding: AXNRing_A
*   Ringtone setting when phone number N is used to call phone number X in the AXN extension binding: AXNRing_N

AXG product:

*   Ringtone setting (with a callback number) when phone number A is used to call phone number X in the AXG binding: AXGRing_AB
*   Ringtone setting (without a callback number) when phone number A is used to call phone number X in the AXG binding: AXGRing_A
*   Ringtone setting when a phone number in number group G is used to call phone number X in the AXG binding: AXGRing_G

Enterprise CRBT codes: Enterprise CRBT codes can be queried in the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account). You can choose **Number Pool Management** > **Enterprise CRBT Management** to view and manage enterprise CRBT codes. You can also upload, delete, or perform other operations on enterprise CRBT codes.

>  The bound enterprise CRBTs are preferentially used. If no enterprise CRBT is set or the setting does not take effect, the enterprise CRBTs at the phone number pool level are used.', example='{"AXBRing_B":"100000001","AXBRing_A":"100000001"}'),
  subsId?: string(name='SubsId', description='The binding ID.

Log on to the [Phone Number Protection console](https://dypls.console.aliyun.com/dypls.htm#/account), choose **Number and Number Pool** > **Number Management**. On the Number Management page, select the desired record and click Details to view the binding ID. Alternatively, you can view the value of the **SubsId** parameter returned by an API operation for a phone number binding such as BindAxb. The value of this parameter indicates a binding ID.

This parameter is required.', example='100000076879****'),
}

model UpdateSubscriptionResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='986BCB6D-C9BF-42F9-91CE-3A9901233D36'),
}

model UpdateSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSubscriptionResponseBody(name='body'),
}

/**
 * @summary Modifies a phone number binding.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 10,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request UpdateSubscriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSubscriptionResponse
 */
async function updateSubscriptionWithOptions(request: UpdateSubscriptionRequest, runtime: Util.RuntimeOptions): UpdateSubscriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ASRModelId)) {
    query['ASRModelId'] = request.ASRModelId;
  }
  if (!Util.isUnset(request.ASRStatus)) {
    query['ASRStatus'] = request.ASRStatus;
  }
  if (!Util.isUnset(request.callDisplayType)) {
    query['CallDisplayType'] = request.callDisplayType;
  }
  if (!Util.isUnset(request.callRestrict)) {
    query['CallRestrict'] = request.callRestrict;
  }
  if (!Util.isUnset(request.expiration)) {
    query['Expiration'] = request.expiration;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.isRecordingEnabled)) {
    query['IsRecordingEnabled'] = request.isRecordingEnabled;
  }
  if (!Util.isUnset(request.operateType)) {
    query['OperateType'] = request.operateType;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNoA)) {
    query['PhoneNoA'] = request.phoneNoA;
  }
  if (!Util.isUnset(request.phoneNoB)) {
    query['PhoneNoB'] = request.phoneNoB;
  }
  if (!Util.isUnset(request.phoneNoX)) {
    query['PhoneNoX'] = request.phoneNoX;
  }
  if (!Util.isUnset(request.poolKey)) {
    query['PoolKey'] = request.poolKey;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ringConfig)) {
    query['RingConfig'] = request.ringConfig;
  }
  if (!Util.isUnset(request.subsId)) {
    query['SubsId'] = request.subsId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSubscription',
    version = '2017-05-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a phone number binding.
 *
 * @description ### [](#qps)QPS limits
 * You can call this operation up to 10,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request UpdateSubscriptionRequest
 * @return UpdateSubscriptionResponse
 */
async function updateSubscription(request: UpdateSubscriptionRequest): UpdateSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSubscriptionWithOptions(request, runtime);
}

